Often in a CBT application, you want to give the subject a chance to study. This example highlights objects as the mouse passes over them, and puts the name of the highlighted object into a field. Note that groups of objects within the main group (such as the Hawaiian islands in the lower-left), highlight as a single unit.
Note also that only named objects and groups highlight. The object representing the Great Lakes in the upper-right part of the map is not named.
ASYM_BeenHere
T6N8I9
Move your mouse cursor over the map to the right.
The state under the mouse pointer highlights, and the name of that state and its capital city appear in the fields below the map.
Slider
label
ASYM_BeenHere
SliderG
A slider is useful when you need a response from your subject that falls within a range. The slider widget sends the following messages:
startSliderMove: sent when the user first clicks on the thumb
sliderMove: sent constantly as the slider is being dragged
endSliderMove: sent when the slider stops moving.
Each of these messages includes the current position of the slider thumb as its parameter. Use the property browser to set the range and scale.1
The slider sends the message endSliderMove when its thumb is set to a new position.
This message is handled by the group that displays the fish.
(Degrees Fahrenheit)
slider
0 > S
mySliderMin
mySliderMax
mysliderPos
myNumTics
scaledSlider
tbk_wid_name
numTics
tallTicSpacing
sliderMin
sliderMax
sliderPos
tbk_wid_props
tbk_wid_values
myTallTicSpacing
thumb
hSliderThumb
txClassName
button id 103 of page id 15
glide
width
false
hilight
myTrackPos
Shuttle
helptext
Button
60.566666666666673
700333333333333344
80.50000000000001e-014
90066666666666669
10033333333333336
800.0000000000001
10000
Select the proper temperature for tropical aquarium.
fishy
,"JU"
,"JK"
Too hot!
problem
health
Too cold!
Just right.
endSliderMove
jmyhealth
sickfish
health
jmyhealth
health
notifyBefore endSliderMove sliderPos
>= 75
<=85
ohealth
"good"
"poor"
M < 75
"Too cold!"
"problem"
{ > 85
+hot!"
"Just
value
"fish"
"sickfish"
myhealth
sickfish
problem
Too cold!t.
Initialize
fishy
sliderPos
health
slider
initialize
initialize
buttonClick
initialize
sliderPos
health
"fishy"
buttonClick
--notifyBefore
Initialize
endSliderMove
sliderMove
startSliderMove
Timer
label
ASYM_BeenHere
Timer
Use this timer widget when you want to limit the amount of time the subject has to answer questions or view material. You can customize the total amount of time on the clock, as well as the subject's time limit.
For example, the script in the Initialize button sets the timer's total time to 60 seconds, and the time limit to 45 seconds. You can specify hours and minutes as well. Use the Property Browser to specify options.
When time is up, the timer sends the message endTime.{
A notify handler in the Initialize button starts the timer running when the page is entered.
When time is up, the timer sends the endTime message, which in this example is handled by the Initialize button.
These widgets will attempt to communicate via DDE with Netscape. If the communication fails, the widgets will read the registration database to locate any browsers associated with the *.htm extension. If a browser is found, it will be launched with the desired URL as an argument..
The combobox will store URLs previously entered to allow easy retrieval.
$ &0G
$@&0G
Object Effect
label
Object Effect
Single
tbk_wid_name
single_object_effect
Single Object
Multiple
tbk_wid_name
multiple_object_effect
Multiple Objects
&Button
This effect works because of a subtle difference between ToolBook's sysLockScreen property and the Windows API function LockWindowUpdate.
You can use these widgets as is for random effects, or alter the scripts to hardwire them to your favorite objects.
ASYM_BeenHere
Applies page navigation effects to individual objects.
Slow-motion
label
ASYM_BeenHere
Slow-motion
Putting this script in a checkbox gives the user the option of slowing ToolBook down by a particular factor set in the script. This script is useful if you need to let the user slow down a process, such as an animation.
notifyBefore idle
if my checked
set lt to lastTime of self
set newTime to timeGetTime()
-- change this number to change degree of slow-down
524480,6,25,25,186,74,,,Edit True or False,8,MS Sans Serif,,2,3,130,55,3607,1342177287,128,Answers:,0,,5,32,125,7,3603,1342177280,130,Text,0,answers,5,13,49,21,3596,1352728577,131,,0,message,5,42,124,11,3604,1350631552,129,,0,ok,136,7,44,12,1,1342242817,128,OK,0,cancel,136,22,44,12,3606,1342242816,128,Cancel,0
tb40dlg.dll
<ManswerMessage
vADialogCallback
=ManswerMessage
2 s_answerMessages
,G3607,Answers:
,S3603,Message to Send When Chosen:
LISTBOX answers,L3596,TRUE
customEdit
SetnListBoxSelection
listBox answers
TBKDialogInit
LISTBOX answers
GetnListBoxSelection
SetControlText
Button ok
GetControlText
endTBKDialog
EDIT message
listBox answers
Button cancel
edit message
2 s_answerMessages
TBKDialogCommand
reader
customEdit
reader
enterPage
author
kGetValue
DialogCallback
GetValue
SetValue
GetnListBoxSelection
GetControlText
SetControlText
SetnListBoxSelection
endTBKDialog
button ok
vSetValue
FALSE
EDIT message,E3604,
BUTtoN ok,B1,TRUE
BUTtoN cancel,B3606,FALSE
listBox answers
524480,6,25,25,186,74,,,Edit True or False,8,MS Sans Serif,,2,3,130,55,3607,1342177287,128,Answers:,0,,5,32,125,7,3603,1342177280,130,Text,0,answers,5,13,49,21,3596,1352728577,131,,0,message,5,42,124,11,3604,1350631552,129,,0,ok,136,7,44,12,1,1342242817,128,OK,0,cancel,136,22,44,12,3606,1342242816,128,Cancel,0
tb40dlg.dll
<ManswerMessage
vADialogCallback
=ManswerMessage
2 s_answerMessages
,G3607,Answers:
,S3603,Message to Send When Chosen:
LISTBOX answers,L3596,TRUE
customEdit
SetnListBoxSelection
listBox answers
TBKDialogInit
LISTBOX answers
GetnListBoxSelection
SetControlText
Button ok
GetControlText
endTBKDialog
EDIT message
listBox answers
Button cancel
edit message
2 s_answerMessages
TBKDialogCommand
reader
customEdit
reader
enterPage
author
NON-ALPHA
,toggleInvert
ALPHA
txClassName
input
initialButton
initialButtonClass
buttonDown
invertedButton
NON-ALPHA
invertedButtonClass
ALPHA
initialButton
initialButtonClass
label
buttonUp
invertedButton
.isChild
NON-ALPHA
,toggleInvert
invertedButtonClass
ALPHA
txClassName
label
buttonStillDown
buttonDoubleClick
FALSE
Enter
labelText
Shift
Caps Lock
input
buttonClick
input
enterPage
1,#!"
invertedButton
NON-ALPHA
invertedButtonClass
ALPHA
label
toggleInvert
FALSE
group
isChild
label
field
ALPHA
txClassName
labelText
b;origLoc
newloc
getsystemmetrics
getsystemmetrics
checkObject
dropTarget
buttondown
labelPosition
b;origLoc
initQuiz
c;origLoc
moved
c;origLoc
label
topLeft
topRight
c;origLoc
point
bottomLine
sized
b;origLoc
newloc
getsystemmetrics
getsystemmetrics
checkObject
dropTarget
buttondown
labelPosition
b;origLoc
initQuiz
c;origLoc
moved
c;origLoc
label
topLeft
topRight
c;origLoc
point
bottomLine
sized
b;origLoc
newloc
getsystemmetrics
getsystemmetrics
checkObject
dropTarget
buttondown
labelPosition
b;origLoc
initQuiz
c;origLoc
moved
c;origLoc
label
topLeft
topRight
c;origLoc
point
bottomLine
sized
JEBEBE
DialogCallback
SetValue
GetValue
AddListBoxItem
DeletenListBoxItem
EnableControl
GetControlText
GetDialogFocus
GetListBoxItems
GetListBoxSelection
GetnListBoxSelection
SetControlText
SetDialogFocus
SetListBoxItems
SetnListBoxSelection
endTBKDialog
vSetValue
listBox answers
524480,9,25,25,228,104,,,Edit Multiple Choice,8,MS Sans Serif,,2,4,171,80,3597,1342177287,128,Answers:,0,,5,59,125,7,3603,1342177280,130,Text,0,answers,5,17,124,39,3596,1352728577,131,,0,add,133,17,37,12,3600,1342242816,128,&Add,0,delete,133,31,37,12,3601,1342242816,128,&Delete,0,edit,133,45,37,12,3602,1342242816,128,&Edit...,0,message,5,69,124,11,3604,1350631552,129,,0,ok,178,7,44,12,1,1342242817,128,OK,0,cancel,178,22,44,12,3606,1342242816,128,Cancel,0
This field formats its value to a standard "spread-sheet" look..c
The widget handles the leavefield message to reformat itself.
Money
Money
tbk_wid_name
$ 234.00
ASYM_BeenHere
True and False
label
True and False
T/F Buttons
buttonDown
<ManswerMessage
buttonUp
editWidget
You chose
answerTrue
You chose
answerFalse
-- Tim Pearson, Asymetrix 1/94
= FALSE
>= TRUE
(answerMessage
editWidget
customEdit
the handlers below
suit your needs --
answerTrue
"You chose" &&
answerFalse
tbk_wid_name
T/F Buttons
tbk_wid_props
editWidget
tbk_wid_values
custom,editWidget
widgetParent
answerMessage
answerTrue
&TRUE
false
answerMessage
answerFalse
&FALSE
T/F Radio Buttons
<ManswerMessage
buttonClick
editWidget
You chose
answerTrue
You chose
answerFalse
-- Tim Pearson, Asymetrix 1/94
buttonClick
(answerMessage
editWidget
customEdit
the handlers below
suit your needs --
answerTrue
"You chose" &&
answerFalse
tbk_wid_name
T/F Radio Buttons
tbk_wid_props
editWidget
tbk_wid_values
custom,editWidget
widgetParent
answerMessage
answerTrue
&TRUE
false
answerMessage
answerFalse
&FALSE
customEdit
reader
enterPage
author
These widgets can be set for true and false questions.
These widgets send a user-defined message. At Reader level you can right-click the group, then click the Custom-edit button on the right-click tool bar to determine which button sends what message.
There is also a to set handler that will display the same editing dialog box. You need to set the editWidget property of the group to any value. For example, select the group, then type in the Command window: set editWidget of selection to 1. This property can also be set from the object properties list given by MTB40.sbk at Author level; just double-click on the editWidget line.
You can place the message handlers in the group script or edit the ones already there.
Most of the work is done in a script in an invisible field. You can get to the script of this field by selecting the appropriate group and executing the following command in the Command window: edit script of item 1 of objects of selection.n....pt of item 1 of objects of selection.
ASYM_BeenHere
Multiple Choice
label
Multiple Choice
CBT Buttons
buttonDown
<ManswerMessage
buttonUp
editWidget
You chose
answer1
You chose
answer2
You chose
answer3
You chose
answer4
-- Tim Pearson, Asymetrix 1/94
= FALSE
>= TRUE
(answerMessage
editWidget
customEdit
the handlers below
suit your needs --
answer1
"You chose" &&
answer2
answer3
answer4
tbk_wid_name
CBT Buttons
tbk_wid_props
editWidget
tbk_wid_values
custom,editWidget
widgetParent
answerMessage
answer1
Answer &1
answerMessage
answer2
Answer &2
answerMessage
answer3
Answer &3
answerMessage
answer4
Answer &4
CBT Radio Buttons
<ManswerMessage
buttonClick
editWidget
You chose
answer1
You chose
answer2
You chose
answer3
You chose
answer4
-- Tim Pearson, Asymetrix 1/94
buttonClick
(answerMessage
editWidget
customEdit
the handlers below
suit your needs --
answer1
"You chose" &&
answer2
answer3
answer4
tbk_wid_name
CBT Radio Buttons
tbk_wid_props
editWidget
tbk_wid_values
custom,editWidget
widgetParent
answerMessage
answer1
Answer &1
answerMessage
answer2
Answer &2
answerMessage
answer3
Answer &3
answerMessage
answer4
Answer &4
customEdit
reader
enterPage
author
You can set these widgets for multiple choice questions.
These widgets send a user-defined message. At Reader level you can right-click the group, then click the Custom-edit button on the right-click tool bar to determine which button sends what message and to edit the buttons' captions.
There is also a to set handler that will display the same editing dialog box. You need to set the editWidget property of the group to any value. For example, select the group, then type in the Command window: set editWidget of selection to 1. This property can also be set from the object properties list given by MTB40.sbk at Author level; just double-click on the editWidget line.
You can place the message handlers in the group script or edit the ones already there.
Most of the work is done in a script in an invisible field. You can get to the script of this field by selecting the appropriate group and executing the following command in the Command window: edit script of item 1 of objects of selection.n...ipt of item 1 of objects of selection.
ASYM_BeenHere
Alpha Keyboard
label
Alpha Keyboard
alphabuttons
buttonPressed
Button id 20 of Page id 72
tbk_wid_name
alphabuttons
The group recognizes which button has been pressed.
Pressing a button causes the group to report to the user what button was pressed. The invert property of that button is set to true until the next button is pressed. When pasted into another book, the buttons are all reset and the group is prepared to work without any manual initialization.
ASYM_BeenHere
QWERTY Keyboard
label
ASYM_BeenHere
QWERTY Keyboard
A qwerty keyboard that returns the letter that is clicked. Click the button to show the large QWERTY keyboard. Clicking the buttons in the keyboard will display text in the field.
N.B. This widget has problems drawing itself in high resolution mode (1024 by 768 or greater) when using large fonts.
Clicking buttons in the key-board will display text in the field.
This widget has problems in 1024 by 768 and large fonts.ts.onts.g large fonts.hen using large fonts..fonts. fonts.onts.ode (1024 by 768 or greater) when using large fonts.
QWERTY-Keyboard
QWERTY_Keyboard
tbk_wid_name
input
ALPHA
txClassName
ALPHA
txClassName
ALPHA
txClassName
ALPHA
txClassName
ALPHA
txClassName
ALPHA
txClassName
ALPHA
txClassName
ALPHA
txClassName
ALPHA
txClassName
ALPHA
txClassName
ALPHA
txClassName
ALPHA
txClassName
ALPHA
txClassName
ALPHA
txClassName
ALPHA
txClassName
ALPHA
txClassName
ALPHA
txClassName
ALPHA
txClassName
ALPHA
txClassName
ALPHA
txClassName
ALPHA
txClassName
ALPHA
txClassName
ALPHA
txClassName
ALPHA
txClassName
ALPHA
txClassName
ALPHA
txClassName
ALPHA
txClassName
ALPHA
txClassName
ALPHA
txClassName
ALPHA
txClassName
ALPHA
txClassName
ALPHA
txClassName
ALPHA
txClassName
ALPHA
txClassName
ALPHA
txClassName
ALPHA
txClassName
ALPHA
txClassName
ALPHA
txClassName
ALPHA
txClassName
ALPHA
txClassName
ALPHA
txClassName
ALPHA
txClassName
ALPHA
txClassName
ALPHA
txClassName
ALPHA
txClassName
ALPHA
txClassName
ALPHA
txClassName
ALPHA
txClassName
Enter
NON-ALPHA
txClassName
NON-ALPHA
txClassName
NON-ALPHA
txClassName
NON-ALPHA
txClassName
NON-ALPHA
txClassName
NON-ALPHA
txClassName
LW:WIW
Caps Lock
NON-ALPHA
txClassName
NON-ALPHA
txClassName
NON-ALPHA
txClassName
NON-ALPHA
txClassName
NON-ALPHA
txClassName
NON-ALPHA
txClassName
NON-ALPHA
txClassName
NON-ALPHA
txClassName
NON-ALPHA
txClassName
NON-ALPHA
txClassName
NON-ALPHA
txClassName
NON-ALPHA
txClassName
NON-ALPHA
txClassName
Shift
NON-ALPHA
txClassName
NON-ALPHA
txClassName
NON-ALPHA
txClassName
NON-ALPHA
txClassName
NON-ALPHA
txClassName
Shift
NON-ALPHA
txClassName
NON-ALPHA
txClassName
NON-ALPHA
txClassName
NON-ALPHA
txClassName
NON-ALPHA
txClassName
enterPage
Can't Touch This
label
Can't Touch This
Cant_Touch_This
1,%!2
mouseEnter
-- Tim Pearson, Asymetrix 1/94
Z INT xOld, yOld, xMin, yMin, xMax, yMax, x, y
/= "0,0"
x =
x >= 0
xTRUE
y =
y >= 0
tbk_wid_name
Cant_Touch_This
Can't Touch This
Cant_Touch_This
enterPage
B"Cant_Touch_This"
orig
3888,3532
ASYM_BeenHere
The descendant of a practical joke, this widget suggests some possibilities for using ToolBook to create interactive games.
Slow-motion
label
ASYM_BeenHere
Slow-motion
This widget is useful if you need to let the user slow down a process, such as an animation.
The checkbox slows ToolBook down by a particular factor set in the script. I
Slow-Motion
nplastTime
oplastTime
newTime
timeGetTime
enterPage
mmsystem
leavePage
oplastTime
timeGetTime
timeGetTime
mmsystem
notifyBefore
lastTime
newTime
timeGetTime()
- lt >= 100
unlinkDLL "mmsystem"
notifyAfter
DWORD
lastTime
Slow-Mo
tbk_wid_name
Slow-Motion
Rainbow
,&H.&
rainbowCount
buttonStillDown
notifyBefore Idle
4rainbowCount
NULL)
k10 = 0)
sObj
saveCol
Ri + 1
sendnotifyBefore
A Rainbow
leavePage
buttonStillDown
enterPage
label
A dial is useful when you need a response from your subject that falls within a range. The dial widget sends the following messages:
startDialMove: sent when the user first clicks on the pointer
dialMove: sent constantly as the pointer is dragged
endDialMove: sent when the pointer is released
Each of these messages includes the current position of the pointer as its parameter. Use the property browser to set the range and scale.
The dial sends the DialMove message as you drag the pointer.
The field below the dial handles the dialMove message in a notify handler.
myStartAngle
myendAngle
myTallTicSpacing
tbk_wid_name
scaleDial
tbk_wid_props
dialPos
dialMin
dialMax
startAngle
endAngle
numTics
tallTicSpacing
tbk_wid_values
myNumTics
mydialMin
mydialMax
myRotation
struct
structInfo
605ti
70433333333333333
805.6666666666667
10099999999999999
950t3
80199999999999999
Display
dialMove
-- picks up message that dial sends
notifybefore dialMove pos
59.79301442010294
Aa@!n
dialMove
enddialMove
dialMove
ASYM_BeenHere
Dial 2
Dragging objects into bins
label
Dragging objects into bins
This example shows an effective use of custom icons and OpenScript's drag and drop commands. When you start dragging an apple or orange, the object is hidden and the cursor is changed to the appropriate shape.
Drag the apples and oranges into their respective baskets...
oranges
targetType
orange
apples
targetType
apple
Apples
Oranges
New pile
pile o fruit
buttonclick
pile o fruit
enterPage
buttonclick
"pile o fruit"
notifyBefore
Restore pile
pile o fruit
buttondown
beginDrag
targetType
objectType
You missed the basket!
You're mixing apples and oranges!
endDrag
drag
>silently
beginDrag
endDrag destObj
targetType
"You missed the basket!"
S <> objectType
>'re mixing apples
oranges!"
objectType
apple
objectType
orange
objectType
apple
objectType
orange
objectType
apple
objectType
orange
objectType
apple
objectType
orange
objectType
apple
objectType
orange
objectType
apple
objectType
orange
objectType
apple
objectType
orange
objectType
apple
$ 4 Y
objectType
orange
B R Y
objectType
apple
` p Y
objectType
orange
objectType
apple
objectType
orange
enterPage
ASYM_BeenHere
Labels
label
Labels
If you need to quiz the subject on elements in an illustration, a good method is to use dragging labels.
Each label below is a widget that automatically handles dragging. The bicycle is a paint object, with a group of transparent graphic objects on top of it. If the label is dropped on a graphic object in this group, the label sends the group a message. The group, in turn, checks to see if the name of the graphic object matches the name of the label group.
Drag the labels to the appropriate parts of the bicycle.
target group
chainRings
toptube
headTube
deraileur
gradeMe
1, #?
1, #?
target group
grade
grade
You got
showWrongAnswers
out of
buttonclick
buttonclick
grade
"You got" &&
%&& "out
" &&
:& "."
showWrongAnswers
Grade me
showAnswers
target group
showRightAnswers
buttonclick
buttonclick
showRightAnswers
Show answers
toptube
origLoc
label
Top tube
bottomLine
topLeft
point
topRight
headTube
origLoc
label
Head tube
bottomLine
topLeft
point
topRight
chainRings
origLoc
5949,2910
label
Chain rings
bottomLine
topLeft
point
topRight
Initialize
initQuiz
buttonclick
initQuiz
enterPage
-- initQuiz
handled
Hnotify handlers
buttonclick
notifyBefore
Initialize
deraileur
origLoc
5026,2910
label
Deraileur
bottomLine
topLeft
point
topRight
4073,2910
ASYM_BeenHere
initQuiz
reader
author
enterPage
5949,2910
3195,2910
Matching Quiz
label
Matching Quiz
The widget below is useful for creating a matching quiz. The two fields below use the OpenScript's drag and drop commands to draw lines from one column to the other.
The widget has the userProperty answers, which is a list of numbers for each item on the left showing its corresponding match on the right. For example, if the subject matched left item 1 with right item 3 and left item 2 with right item 6, the userProperty answers would return "2,6" when queried. You can also set answers to a list, which will result in the lines being drawn to their appropriate positions.
Drag and drop from left to right to match each artist with the appropriate movement.
MatchingQuiz
tbk_wid_name
MatchingQuiz
tbk_wid_props
answers
tbk_wid_values
false
"textlinefrompoint
allowDrag
BlineNum
"textlinefrompoint
beginDrag
BlineNum
endDrag
reader
author
author
enterpage
allowDrag
tlfp
textlinefrompoint(
beginDrag
lineNum
endDrag
notifyBefore
lineNum
Monet
Raphael
Picasso
Courbet
Redon
zanne
right
.', "
"textlinefrompoint
BlineNum
edrawLine
objectDropped
false
"textlinefrompoint
targName
allowDrop
reader
author
author
enterpage
objectDropped sourceObj
tlfp
textlinefrompoint(
drawLine lineNum
allowDrop
targName
notifyBefore
lineNum
Realism
Symbolism
Post-impressionism
Classicism
Impressionism
Romanticism
Cubism
gradeMe
V, #?
FManswers
rightanswers
score
You got
studentAnswers
out of
matchingQuiz
buttonclick
buttonclick
studentAnswers
answers
"matchingQuiz"
rightanswers
5,4,6,7,1,2,3
answerCount =
(rightAnswers)
score = 0
"You got" &&
E&& "out
u& "."
Grade me
showAnswers
GManswers
matchingQuiz
buttonclick
buttonclick
answers
matchingQuiz
5,4,6,7,1,2,3
Show answers
Initialize
GManswers
matchingQuiz
buttonclick
GManswers
matchingQuiz
enterPage
-- initQuiz
handled
Hnotify handlers
buttonclick
answers
"matchingQuiz"
notifyBefore
Initialize
enterPage
'aracter
paragraph
leavepage
reader
author
ASYM_BeenHere
character
1, "j
.', "
minus
searchReplace
/searchReplace
0]outLineNumber
minus
indentLevel
curLevel
subheadings
buttonDoubleClick
keyDown
.'+ +
source
/searchReplace
curmode
subheadings
source
operatingMode
reader
B7oldBook
JFoperatingmode
enterPage
JFoperatingmode
author
JFoperatingmode
reader
source
textLineNumber
indentLevel
subHeadings
,&H.&
counter
indentLevel
indentLevel
outlineNumber
false
indentLevel
foundNextSibling
textlineNumber
A7oldBook
minus
Use copy, not cut, on this widget.
Cancel
B7oldBook
You must save this book before copying this widget.
,"JdY
1,"EL
barWeight
defValues
defValues
PlotValues
defValues
plotValues
Y=myPlotWeight
plotValues
risNumber
barWeight
PlotWeight
X=myPlotWeight
plotWeight
,&H.&
risNumber
eEmyPlotColors
PlotColors
dEmyPlotColors
plotColors
isNumber
false
showframe
author
showFrame
enterPage
showFrame
author
false
showFrame
reader
.'+ +F
linVertices
vValLine
oldCursor
linObj
defValues
defValues
PlotValues
defValues
plotValues
,"Jd"
.', "
.', "
,&H.&
Y=myPlotWeight
risNumber
PlotWeight
X=myPlotWeight
plotWeight
,&H.&
risNumber
eEmyPlotColors
PlotColors
dEmyPlotColors
PlotColors
isNumber
false
showframe
author
showFrame
enterPage
showFrame
author
false
showFrame
reader
FALSE
txClassName
Thumb
setSliderLimits
buttonDown
1,#!#
false
s_sliderPosition
HSliderThumb
s_sliderv
VSliderThumb
txClassName
s_sliderMin
s_sliderMax
oslidePos
9sldrPosition
buttonStillDown
s_sliderV
false
snapSlider
s_sliderPosition
HSliderThumb
VSliderThumb
txClassName
s_sliderMin
s_sliderMax
oslidePos
sliderPosition
buttonUp
s_sliderV
HSliderThumb
VSliderThumb
txClassName
s_sliderMin
s_sliderMax
glide
setSliderLimits
slidePos
9sldrPosition
sliderPosition
newPos
OldMax
hSliderThumb
pOffset
group
SliderThumb
OldMin
vSliderThumb
txClassName
s_sliderMin
s_sliderMax
thumb
setSliderLimits
sliderPosition
9sldrPosition
sliderPosition
detentList
snapSlider
txClassName
Thumb
setSliderLimits
buttonDown
1,#!#
s_sliderPosition
HSliderThumb
s_sliderv
VSliderThumb
txClassName
s_sliderMin
s_sliderMax
oslidePos
9sldrPosition
buttonStillDown
s_sliderV
snapSlider
s_sliderPosition
HSliderThumb
VSliderThumb
txClassName
s_sliderMin
s_sliderMax
oslidePos
sliderPosition
buttonUp
s_sliderV
}[centered
HSliderThumb
height
VSliderThumb
txClassName
s_sliderMin
s_sliderMax
width
glide
setSliderLimits
slidePos
9sldrPosition
sliderPosition
newPos
OldMax
hSliderThumb
pOffset
group
SliderThumb
OldMin
vSliderThumb
txClassName
s_sliderMin
s_sliderMax
thumb
setSliderLimits
sliderPosition
9sldrPosition
sliderPosition
detentList
snapSlider
sliderMove
sliderMax
sliderMin
sliderMax
sliderBounds
sliderMin
nearestPupp
thumb
mySliderPos
nearestPUPP
sliderPos
sliderMax
curfield
numTics
mtallTicSpacing
sliderMin
DxCenter
LnumTics
adjustNumbers
xCenter
mySliderMax
sliderMin
W\adjustNumbers
is invalid.
sliderMin
sliderMax
sliderMax
sliderMax
mySliderMin
W\adjustNumbers
is invalid.
sliderMin
,&H.&
myTallTicSpacing
W\adjustNumbers
tallTicSpacing
curLine
sliderMax
sliderMin
thumb
sliderMax
sliderBounds
W\adjustNumbers
sliderMin
numTics must be a value between 1 and 50.
myNumTics
nearestPupp
nearestPUPP
leftMost
numTics
myTallTicSpacing
tallTicSpacing
mySliderMin
sliderMin
myNumTics
numTics
mySliderMax
sliderMax
mySliderPos
sliderPos
startSliderMove
sliderMove
endSliderMove
nearestPUPP
getSystemMetrics
getSystemMetrics
primaryMouseButton
DialogCallback
SetValue
GetValue
AddListBoxItem
DeletenListBoxItem
EnableControl
GetControlText
GetDialogFocus
GetListBoxItems
GetListBoxSelection
GetnListBoxSelection
SetControlText
SetDialogFocus
SetListBoxItems
SetnListBoxSelection
endTBKDialog
vSetValue
listBox answers
524480,9,25,25,228,104,,,Edit Multiple Choice,8,MS Sans Serif,,2,4,171,80,3597,1342177287,128,Answers:,0,,5,59,125,7,3603,1342177280,130,Text,0,answers,5,17,124,39,3596,1352728577,131,,0,add,133,17,37,12,3600,1342242816,128,&Add,0,delete,133,31,37,12,3601,1342242816,128,&Delete,0,edit,133,45,37,12,3602,1342242816,128,&Edit...,0,message,5,69,124,11,3604,1350631552,129,,0,ok,178,7,44,12,1,1342242817,128,OK,0,cancel,178,22,44,12,3606,1342242816,128,Cancel,0
tb40dlg.dll
<ManswerMessage
,G3597,Answers:
,S3603,Message to Send When Chosen:
LISTBOX answers,L3596,
BUTtoN add,B3600,NODISMISS
BUTtoN delete,B3601,NODISMISS
BUTtoN edit,B3602,NODISMISS
EDIT message,E3604,
BUTtoN ok,B1,TRUE
BUTtoN cancel,B3606,FALSE
vADialogCallback
2 s_answerMessages
customEdit
SetControlText
listbox answers
SetnListBoxSelection
listBox answers
button delete
edit message
jGetListBoxSelection
AEnableControl
GetListBoxItems
TBKDialogInit
1+5!7
V, #>
.&, #>
.&, #>
.&, #>
Cancel
QOtbk_wid_props
wAddListBoxItem
custom,editWidget
LISTBOX answers
button
gobjLayer
GetnListBoxSelection
Button add
SetControlText
GvSetDialogFocus
listbox answers
Button delete
send (answerMessage of target) to target
SetnListBoxSelection
endTBKDialog
newAnswer
GetControlText
lGetDialogFocus
answer
Multiple Choice
Button edit
EDIT message
listBox answers
send customEdit to item 1 of my objects
Answer &
button delete
Answer Caption:
4DeletenListBoxItem
Button ok
editWidget
edit message
Button cancel
SetListBoxItems
=ManswerMessage
jGetListBoxSelection
sptbk_wid_values
tbk_wid_name
AEnableControl
to handle buttonClick
2 s_answerMessages
GetListBoxItems
to set editWidget
TBKDialogCommand
page,background
objLayer
reader
customEdit
reader
enterPage
author
b;origLoc
newloc
getsystemmetrics
getsystemmetrics
checkObject
dropTarget
buttondown
labelPosition
b;origLoc
initQuiz
c;origLoc
moved
c;origLoc
label
topLeft
topRight
c;origLoc
point
bottomLine
sized
enterPage
s_lheight
leavepage
linkStuff
s_lheight
FManswers
GManswers
s_lheight
fontChange
fontChange
character
fontChange
paragraph
FManswers
right
GManswers
sized
FManswers
right
GManswers
moved
false
answerList
edrawLine
answers
answerList
answers
leftRef
rightRef
false
right
angLine
rightY
leftTLBE
rightTLBE
answerList
textLineBeginEnd
answerList
leftY
drawLine
lineheight
stringLen
leftBound
rightbound
midLine
/$stringHeight
textLineBeginEnd
lineheight
stringLen
textLineFromPoint
SIgetTextExtent
selectObject
deleteObject
createFont
getDC
releaseDC
linkstuff
,"JHY
selectObject
hOldObject
}releaseDC
Failure: no logical font created.
getDC
createFont
hfont
weight
makefont
.', "
selectObject
deleteObject
hOldObject
}releaseDC
hfont
destroyFont
UdmakeFont
destroyFont
s_lheight
/$stringHeight
lineheight
UdmakeFont
destroyFont
retval
jogetTextExtent
stringLen
jogetTextExtent
stringHeight
nearestPUPP
sliderMove
sliderMax
sliderMin
mysliderPos
sliderMax
sliderBounds
sliderMin
nearestPupp
thumb
nearestPUPP
sliderPos
sliderMax
curfield
numTics
mtallTicSpacing
sliderMin
DxCenter
LnumTics
adjustNumbers
xCenter
mySliderMax
sliderMin
W\adjustNumbers
is invalid.
sliderMin
sliderMax
sliderMax
sliderMax
mySliderMin
W\adjustNumbers
is invalid.
sliderMin
,&H.&
myTallTicSpacing
W\adjustNumbers
tallTicSpacing
curLine
sliderMax
sliderMin
thumb
sliderMax
sliderBounds
W\adjustNumbers
sliderMin
numTics must be a value between 1 and 50.
myNumTics
nearestPupp
nearestPUPP
leftMost
numTics
myTallTicSpacing
tallTicSpacing
mySliderMin
sliderMin
myNumTics
numTics
mySliderMax
sliderMax
mysliderPos
sliderPos
sliderMove
endSliderMove
secsAngle
totalTime
kDcurTime
sweep
oldTime
handVertices
jDcurTime
coords
radius
totalSecs
clocktime
?handVertices
myTotalTime
totalTime
1, #b
1, #>
minutes
timeFormat
quarter
is not a valid time format.
seconds
threeQuarters
myTotalTime
hours
MVmyRound
totalTime
myRound
totaltimeLimit
minutes
totaltimeLimit
timeFormat
is not a valid time format.
clockTime
seconds
totalTime
totalTime
hours
timeLimit
seconds
totaltimeLimit
timeLimit
timeStart
timeGetTime
startTime
buttonstilldown
timeStart
timeStart
kDcurTime
clocktime
timeGetTime
curTime
totaltimeLimit
4endtime
endtime
timeStart
kDcurTime
clockTime
leavepage
timeGetTime
mmsystem
enterpage
Etemplet
enterField
w, #>
vgetCurrentDirectory
getCu
Self-sorting Field
label
Self-sorting Fielda
tbk_wid_name
lText
scrambleText
.'+ +F
$scrambleText
|sortSelf
default
buttonClick
scrambleText
ZSTRING unsortedText
lText =
"Sort"
lTextCount = textlineCount(
N& CRLF
buttonClick
sortSelf
o= default
scramble text and sort
cancel
Please supply a textline to insert.
insertLine
newLine
buttonClick
buttonClick
("Please supply a
insert."
r<> "
newLine
insertLine
insert a textline
tbk_wid_name
APP850.FON
APPS.INF
ARCADE.BMP
ARGYLE.BMP
ARIALB.FON
ARIALBD.FOT
ARIALBD.TTF
ARIALBI.FOT
ARIALBI.TTF
ARIALI.FOT
ARIALI.TTF
BLUEMAX.VXD
CALC.EXE
CALC.HLP
CAN_ADF.EXE
CANON10E.DRV
CANON130.DRV
CANON330.DRV
CANYON.MID
CARDFILE.EXE
CARS.BMP
CASTLE.BMP
CGA.2GR
CGA40850.FON
CGA40WOA.FON
CGA80850.FON
CGA80WOA.FON
CGALOGO.RLE
CHARMAP.EXE
CHARMAP.HLP
CIT9US.DRV
CITOH.DRV
CLIPBRD.EXE
CLIPSIBM.SHH
CLIPSRV.EXE
CLOCK.EXE
COMM.DRV
COMMCTRL.DLL
CONTROL.EXE
CONTROL.SRC
COUR.FOT
COUR.TTF
COURBD.FOT
COURBD.TTF
COURE.FON
DDEML.DLL
DEC2150.WPD
DEC2250.WPD
DEC3250.WPD
DECCOLOR.WPD
DECLPS20.WPD
DEMILAYR.DLL
DEPCA.DOS
DISK2
DISK8
DISK9
DISKA
DISKB
DOSAPP.FON
DOSX.EXE
DRIVERS.CPL
DRWATSON.EXE
DSWAP.EXE
EGA.3GR
EGA.DRV
EGA.SYS
EGA40850.FON
EGA40WOA.FON
EGACOLOR.2GR
EGAHIBW.DRV
EGALOGO.RLE
EGAMONO.2GR
EGAMONO.DRV
EGAMONO.LGO
EGAMONO.RLE
EGAOEM.FON
EGYPT.BMP
ELNK3.DOS
ELNKMC.DOS
ELNKPL.DOS
EPL75523.WPD
EPSON9.DRV
ESCP2.DRV
EVX16.DOS
EXECJET.DRV
EXP16.DOS
EXPAND.EXE
FINSTALL.DLL
FINSTALL.HLP
GDI.EXE
GENDRV.DLL
HERC850.FON
HERCLOGO.LGO
HERCLOGO.RLE
HERCULES.2GR
HERCWOA.FON
HERMES_2.WPD
HIMEM.SYS
HONEY.BMP
HP_3P522.WPD
HPIID522.WPD
HPIIP522.WPD
HPLANB.DOS
HPMOUSE.DRV
HPPCL.DRV
HPPCL5MS.DRV
HPPLOT.DRV
HPSYSTEM.DRV
HRMDG.SHH
IBM39521.WPD
IBM4019.DRV
IBM5204.DRV
IBMCOLOR.DRV
IMPEXP.DLL
IPX.OBJ
KBDBE.DLL
KBDCA.DLL
KBDDV.DLL
KBDFI.DLL
KBDGR.DLL
KBDHP.DRV
KBDIT.DLL
KBDNE.DLL
KBDPO.DLL
KBDSF.DLL
KBDSG.DLL
KBDSP.DLL
KBDSW.DLL
KBDUK.DLL
KBDUS.DLL
KBDUSX.DLL
KEYBOARD.DRV
KRNL286.EXE
L300_493.WPD
L630_52&.WPD
LANGDUT.DLL
LANGENG.DLL
LANGFRN.DLL
LANGGER.DLL
LANGSPA.DLL
LBPIII.DRV
LMOUSE.DRV
LMSCRIPT.EXE
LMSCRIPT.PIF
LSL.COM
LVMD.386
LZEXPAND.DLL
MAC586.SYS
MADGE
MAILMGR.DLL
MAILSPL.EXE
MAPI.DLL
MCISEQ.DRV
MIDIMAP.DRV
MIS.SHH
MMSYSTEM.DLL
MMTASK.TSK
MMTLHI.DRV
MMTLLO.DRV
MODERN.FON
MORICONS.DLL
MOUSE.COM
MOUSE.DRV
MOUSE.SYS
MOUSEHP.COM
MPLAYER.EXE
MPU401.DRV
MSADLIB.DRV
MSD.INI
MSHEARTS.EXE
MSHEARTS.HLP
MSMAIL.EXE
MSMAIL.HLP
MSNET.DRV
MSREMIND.EXE
MSSCHED.DLL
MSSFS.DLL
MT_TI101.WPD
N2290520.WPD
N2990523.WPD
N890_470.WPD
N890X505.WPD
NDDEAPI.DLL
NDIS39XR.DOS
NE1000.DOS
NE2000.DOS
NEC24PIN.DRV
NET.EXE
NETAPI.DLL
NETDDE.EXE
NETH.MSG
NETWARE.DRV
NETWARE.HLP
NETWATCH.EXE
NETWORK.INF
NOTEPAD.EXE
NOTEPAD.HLP
NWPOPUP.EXE
OKI9.DRV
OKI9IBM.DRV
OL840518.WPD
OLESVR.DLL
OLIGRAB.2GR
PACKAGER.EXE
PACKAGER.HLP
PANSON24.DRV
PBRUSH.HLP
PE2NDIS.EXE
PIFEDIT.EXE
PLASMA.DRV
PMSPL.DLL
POWER.DRV
POWER.HLP
PRINTMAN.EXE
PRINTMAN.HLP
PRO4.DOS
PROGMAN.EXE
PROGMAN.HLP
PROPRINT.DRV
PROPRN24.DRV
PRORAPM.DWN
PROTMAN.EXE
PSCRIPT.DRV
Q2200510.WPD
Q820_517.WPD
QWIII.DRV
README.WRI
RECORDER.DLL
RECORDER.EXE
RECORDER.HLP
REGEDITV.HLP
RINGIN.WAV
RIVETS.BMP
ROMAN.FON
ROUTE.COM
SCHDPLUS.EXE
SCHEDMSG.DLL
SEIKO_04.WPD
SEIKO_14.WPD
SENDFILE.DLL
SERIFB.FON
SERIFE.FON
SERIFF.FON
SETUP.EXE
SETUP.INI
SETUP.REG
SETUP.TXT
SF4019.EXE
SHELL.DLL
SL.HLP
SMALLB.FON
SMARTDRV.EXE
SMARTND.DOS
SMC_ARC.DOS
SMC3000.DOS
SMCMAC.DOS
SNDBLST.DRV
SQUARES.BMP
SSERIFB.FON
SSERIFE.FON
SSMARQUE.SCR
STORE.DLL
SUPERVGA.DRV
SYMBOL.TTF
SYMBOLB.FON
SYSEDIT.EXE
SYSINI.WRI
SYSTEM.DRV
SYSTEM.SRC
TASKMAN.EXE
TBMI2.COM
TCCARC.DOS
TERMINAL.EXE
TERMINAL.HLP
TESTPS.TXT
THATCH.BMP
THINKJET.DRV
TI850.DRV
TIGA.DRV
TIM17521.WPD
TIM35521.WPD
TIMES.FOT
TIMESB.FON
TIMESBD.FOT
TIMESBD.TTF
TIMESBI.FOT
TIMESBI.TTF
TIMESI.FOT
TIMESI.TTF
TKPHZR21.WPD
TKPHZR31.WPD
TOOLHELP.DLL
TRIUMPH2.WPD
TRNSCHED.DLL
TTY.DRV
TTY.HLP
U9415470.WPD
USER.EXE
USREDIBM.SHH
V7VDD.386
V7VGA.3GR
V7VGA.DRV
VADLIBD.386
VBROWSE.386
VDDCGA.386
VDDHERC.386
VDDTIGA.386
VDDTLI4.386
VDDVGA30.386
VDDXGA.386
VDMAD.386
VER.DLL
VGA.3GR
VGA.DRV
VGA850.FON
VGA861.FON
VGA865.FON
VGACOLOR.2GR
VGADIB.3GR
VGAFIX.FON
VGALOGO.RLE
VGAMONO.2GR
VIPX.386
VNB.386
VNETBIOS.386
VNETSUP.386
VNETWARE.386
VPD.386
VPICD.386
VPOWERD.386
VREDIR.386
VSERVER.386
VWC.386
WFWNET.HLP
WGPOMGR.DLL
WIN.CNF
WIN.SRC
WIN386.EXE
WIN87EM.DLL
WINCHAT.EXE
WINCHAT.HLP
WINDOWS.LOD
WINFILE.EXE
WINFILE.HLP
WINGDING.TTF
WINHELP.EXE
WININI.WRI
WINLOGO.BMP
WINMINE.EXE
WINTUTOR.DAT
WINVER
WORKGRP.SYS
WRITE.EXE
WRITE.HLP
WSWAP.EXE
XGA.DRV
XLAT861.BIN
XMSMMGR.EXE
ZIGZAG.BMPPPMMGR.EXE
ZIGZAG.BMPXE
COMM.DRV
Q2200510.WPD
SCHDPLUS.EXE
SUPERVGA.DRV
KBDHP.DRV
SERIFE.FON
VGA865.FON
SYMBOL.TTF
VREDIR.386
FINSTALL.HLP
HIMEM.SYS
V7VDD.386
N2290520.WPD
DDEML.DLL
MSMAIL.HLP
HPPCL5MS.DRV
SYSINI.WRI
WINCHAT.EXE
VDDXGA.386
ARIALBD.TTF
POWER.HLP
EGYPT.BMP
SYSEDIT.EXE
SSMARQUE.SCR
IBM4019.DRV
CHARMAP.HLP
VDDTLI4.386
DECCOLOR.WPD
HERCLOGO.LGO
TIMESI.TTF
ARIALBD.FOT
SL.HLP
README.WRI
PACKAGER.EXE
NETAPI.DLL
LMOUSE.DRV
CANON330.DRV
EGA.3GR
PRO4.DOS
OKI9.DRV
TIMESBD.TTF
KBDGR.DLL
VNB.386
EGA.SYS
N890_470.WPD
VNETSUP.386
COURBD.FOT
HPPCL.DRV
DISK8
ROMAN.FON
KBDCA.DLL
SERIFB.FON
MOUSEHP.COM
CGA.2GR
PRINTMAN.HLP
LZEXPAND.DLL
DOSAPP.FON
WIN.CNF
ZIGZAG.BMP
VBROWSE.386
TIM17521.WPD
WINVER
VNETBIOS.386
MOUSE.DRV
QWIII.DRV
PROGMAN.HLP
WSWAP.EXE
EPSON9.DRV
PMSPL.DLL
WORKGRP.SYS
SSERIFB.FON
MODERN.FON
COMMCTRL.DLL
WINFILE.EXEPP.EXE
WRITE.HLP
WSWAP.EXE
XGA.DRV
XLAT861.BIN
XMSMMGR.EXE
ZIGZAG.BMPDTIGA.386
CLIPBRD.EXE
GLOSSARY.HLP
TTY.HLP
VCD.386
LANGGER.DLL
SETUP.HLP
PS1.DRV
VGALOGO.RLE
VWC.386
PROGMAN.EXE
EGA80850.FON
POWER.HLP
FINSTALL.DLL
N890_470.WPD
TERMINAL.EXE
LMSCRIPT.EXE
NETWARE.DRV
COMM.DRV
MSREMIND.EXE
MSNET.DRV
HPLANB.DOS
EGACOLOR.2GR
MT_TI101.WPD
ELNKPL.DOS
8514FIX.FONNN.HLP
VCD.386
LANGGER.DLL
SETUP.HLP
PS1.DRV
VGALOGO.RLE
VWC.386
PROGMAN.EXE
EGA80850.FON
POWER.HLP
FINSTALL.DLL
N890_470.WPD
TERMINAL.EXE
LMSCRIPT.EXE
NETWARE.DRV
COMM.DRV
MSREMIND.EXE
MSNET.DRV
HPLANB.DOS
EGACOLOR.2GR
MT_TI101.WPD
ELNKPL.DOS
8514FIX.FONNNDOS
FINSTALL.HLP
CONTROL.SRC
DECLPS20.WPD
VPICD.386
KBDIT.DLL
VGADIB.3GR
CANYON.MID
SYSTEM.SRC
VDDTIGA.386
CLIPBRD.EXE
GLOSSARY.HLP
TTY.HLP
VCD.386
LANGGER.DLL
SETUP.HLP
PS1.DRV
VGALOGO.RLE
VWC.386
PROGMAN.EXE
EGA80850.FON
POWER.HLP
FINSTALL.DLL
N890_470.WPD
TERMINAL.EXE
LMSCRIPT.EXE
NETWARE.DRV
COMM.DRV
MSREMIND.EXE
MSNET.DRV
HPLANB.DOS
EGACOLOR.2GR
MT_TI101.WPD
ELNKPL.DOS
8514FIX.FON
VWC.386
WFWNET.DRV
WFWNET.HLP
WFWSETUP.CPL
WGPOMGR.DLL
WIN.CNF
WIN.SRC
WIN386.EXE
WIN386.PS2
WIN87EM.DLL
WINCHAT.EXE
WINCHAT.HLP
WINDOWS.LOD
WINFILE.EXE
WINFILE.HLP
WINGDING.FOT
WINGDING.TTF
WINHELP.EXE
WINHELP.HLP
WININI.WRI
WINLOGO.BMP
WINMETER.EXE
WINMINE.EXE
WINMINE.HLP
WINOA386.MOD
WINOLDAP.MOD
WINTUTOR.DAT
WINTUTOR.EXE
WINVER
WORKGRP.SYS
WRITE.EXE
WRITE.HLP
WSWAP.EXE
XGA.DRV
XLAT850.BIN
XLAT860.BIN
XLAT861.BIN
XLAT863.BIN
XLAT865.BIN
XMSMMGR.EXE
ZIGZAG.BMP
ZIGZAG.BMP<
This self-sorting field has scripts for sorting any text placed in it, and for inserting any textline in sorted order.
To sort text in this widget field, set the text of the field to the text you want sorted, then send the field the message sortSelf.
To insert a new line into the text, send the field the message insertLine with the text of the new line as a parameter..The "insert a textline" button has this script:
clear sysError
ask "Please supply a textline to insert."
if sysError <> "cancel"
set newLine to it
send insertLine newLine to field "sort"
endror
ask "Please supply a textline to insert."
if sysError <> "cancel"
set newLine to it
send insertLine newLine to field "sort"
Scramble and Sort
Insert
ASYM_BeenHere
Searching Field
label
ASYM_BeenHere
Searching Field
By typing in the field at the top, you can find an entry in the field below.
In response to the enterPage message for this page, the scrolling field fills an array with its text. This helps speed the search that takes place after each keyDown message in the upper field.
search
search
tbk_wid_name
index
.'+ +
itemArray
enterPage
buttonUp
notifyBefore
4ARRAY STRING itemArray[]
fill
B] order
oselectedTextlines
activate
after
again
alias
align
angle
application
argument
ascending
background
backgroundimage
before
bitand
bitnot
bitor
bitshiftleft
bitshiftright
bitxor
break
caption
changes
character
characters
chars
check
chooseresource
clear
close
closefile
closeremote
commandwindow
conditions
contains
context
continue
createfile
deactivate
decrement
default
descending
dimensions
direction
disable
dynamic
eighth
eject
enable
excluding
execute
executeremote
export
extend
fifth
first
fixed
format
forward
fourth
fxdissolve
fxwipe
fxzoom
getremote
graphic
handle
helptext
import
importgraphic
increment
insteadof
items
keepremote
linkdll
local
locateonly
magnify
menubar
menuenabled
menuitem
menuitemchecked
menuitemenabled
menustate
middle
minimized
modal
ninth
normal
notactive
notifyafter
notifybefore
number
openfile
order
pageimage
password
pause
previous
print
properties
readfile
records
reference
remove
request
reset
resource
resourcecount
resourcelist
respondremote
restore
return
scrollbar
search
second
seconds
seekfile
select
sendnotifyafter
sendnotifybefore
separator
setmenuhelptext
setmenuitemhelptext
setmenuitemname
setmenuname
setremote
seventh
shift
silently
sixth
speed
spooler
start
store
target
tenth
textfrompoint
textline
textlines
third
ticks
topic
transition
translatewindowmessage
uncheck
unlinkdll
unselect
until
untranslateallwindowmessages
untranslatewindowmessage
using
variable
variables
while
window
within
without
words
writefile
seed
seekfile
select
self
send
sendnotifyafter
sendnotifybefore
separator
set
setmenuhelptext
setmenuitemhelptext
setmenuitemname
setmenuname
setremote
seventh
shift
show
silently
sixth
slow
sort
speed
spooler
start
step
store
target
tenth
textfrompoint
textline
textlines
then
third
this
ticks
time
to
tool
topic
transition
translatewindowmessage
uncheck
unlinkdll
unselect
until
untranslateallwindowmessages
untranslatewindowmessage
using
variable
variables
when
while
window
with
within
without
word
words
writefilefile
enterPage
Better Combobox
label
Better Combobox
maxSize
"LmaxSize
enterDropdown
enterDropdown
maxSize =
(dropDownItems
lineCount
scrollable
= TRUE
= FALSE
tbk_wid_name
BetterCombo
tbk_wid_props
maxSize
tbk_wid_values
list,1,2,3,4,5,6,7,8,9,10
maxSize
Brenda
Frank
Brenda
Willy
This combobox knows to set the size of the dropdown field intelligently.
This combobox will set the size of the dropdown field to the number of entries, but only if that number doesn't exceed a certain amount. That limit is in the userProperty of the combobox maxSize. If the number of dropdown items is greater than maxSize, the dropdown field gets a scrollbar...
ASYM_BeenHere
Drag a Textline
label
Drag a Textline
DragTextline
dragTextLine
beginDrag
+#,""
+#,I4
+#,"J
+#,I4
2, #>
+#,I4
dragTextLine
stillOverDrop
beginDrag
dragTextLine
oselectedTextLines =
stillOverDrop pObject, loc
currentTextLine
currentTextline =
&CRLF
+ 1
dragTextline =
tbk_wid_name
DragTextline
smith
You can drag any textline to a new position in the field below.
This field allows you to drag a textline up or down and displays the results as you drag.
ASYM_BeenHere
Drag and Drop Text
label
Drag and Drop Text
Drag_Drop_Text
tbk_wid_name
Drag_Drop_Text
Drag&Drop:
Select some text in this field and drag it to the other field s. One of the other fields allows drops, the other doesn't. Test,
stest
tetstetst
stillOverDrop
enterDrop
stillOverDrop sourceObj, loc
FALSE
caretLocation
enterDrop
This widget enables you to select text, then drag it into another field.
This widget allows you to drag any text out of it and then drop that text into any field that has its allowDrop property set to true. You can create such a field in the application you paste the widget into by drawing a field, then setting allowDrop to true from the Field Property dialog box.
ASYM_BeenHere
Drop_Target
06cleanUp
leavePage
,&H.&
dropFiles
cleanUp
cleanUp
objs =
c"OLE"
"dropFiles"
Multiple OLE Drag and Drop
label
Multiple OLE Drag and Drop
Drag files from the File Manager into the field below.
This field extends ToolBook's OLE capabilities by accepting multiple objects simultaneously, and by displaying the file names of the OLE objects.
Just before each drop and at the leavePage message, the OLE objects already on the page are deleted and the text of the field is cleared. This is a function of the page, not the widget.
This widget is a good example of using Windows directly from ToolBook to do something that is otherwise not possible in ToolBook.
While it isn't usually necessary, you can link directly to Windows from ToolBook. This example takes advantage of a Windows capability not built into ToolBook.
ASYM_BeenHere
Simple Bar Chart
label
Animate
Simple Bar Chart
Use this widget to show up to 6 values. The buttons on this page all exercise the widget by setting its properties to the desired values.
Set plotValues of the group to two numbers. The numbers will be automatically normalized to add up to 100%. Set plotweight to a number between 1 and 100. Set plotColors of the group to HLS color values or color names for the bars.
Example: set plotColors of group "Chart One" to "green, 78,56,35""ample: set plotColors of group "Chart One" to "green, 78,56,35" of group "Chart One" to "green, 78,56,35"""5, 150
Note: The chart gets redrawn with the current values when you change the plotOrigin.
Set plotColors of the group to HLS color values or color names for the two slices.
Example: set plotColors of group "Chart One" to "green, 78,56,35"et plotColors of group "Chart One" to "green, 78,56,35"""ith the current values when you change the plotOrigin.
Set plotColors of the group to HLS color values or color names for the two slices.
Example: set plotColors of group "Chart One" to "green, 78,56,35"
Chart one
1,0.715565031982942,0.526226012793177
defValues
Weights
barWeight
BarChart
tbk_wid_name
PlotValues
PlotWeight
PlotColors
tbk_wid_props
tbk_wid_values
myPlotWeight
magenta,cyan,yellow,red,blue,green
myPlotColors
plotValues
chart one
buttonUp
plotValues
"chart one"
1,2,3,4,5,6
plotValues
chart one
buttonUp
plotValues
"chart one"
2345, 1678, 1234
plotColors
blue,red,green,magenta,cyan,yellow
chart one
buttonUp
plotColors
"chart one"
Color Scheme 1
plotColors
magenta,cyan,yellow,red,blue,green
chart one
buttonUp
plotColors
"chart one"
Color Scheme 2
.'+ +F
.'+ +F
plotValues
plotValues
chart one
oldCursor
plotValues
tempVals
chartObj
buttonUp
oldCursor
-- This example recycles the current data
shown
-- chart
{. In a real
, you would
-- some other
-- Get
[bar height, store
display
minimum
chartObj =
yone"
plotValues =
barCount =
tempVals
-- Now
animation
v =
v < 0
incVal = -0.1
Animate
plotValues
chart one
buttonUp
plotValues
"chart one"
.1, -.5
plotWeight
Chart one
buttonUp
plotWeight
"Chart one"
Bar Weight::
enterPage
author
reader
Values 1,2,3,4,5,6
Values .1, -.5
Values 2345, 1678, 1234
Color Scheme 1
Color Scheme 2
ASYM_BeenHere
Simple Line Chart
label
ASYM_BeenHere
Simple Line Chart
This widget plots up to 6 series of up to 25 points each. Just set its plotValues property to the data you want. Other properties control appearance details..o
Set plotValues of the chart to a string containing as many as 6 textlines containing up to 25 numbers each. Values should be floating point numbers between -1 and 1, or any number. If a value exceeds -1 or 1, the values in the series will be normalized so that the highest one is assumed to be as high as the chart will allow. You can use any number of values but at least 2 and no more than 25 in any textline of the data.
Example: set plotValues of group "Chart One" to "100,200,400,200" & CRLF & "123,345,523,234"
Set plotWeight of the group to a relative thickness for the lines. This should be a number between 1 and 100.
Example: set plotWeight of group "Chart One" to 60
Note: The chart gets redrawn with the current values when you change the plotWeight.
Set plotColors of the group to up to 6 HLS color values or color names.
Example: set plotColors of group "Chart One" to "green, magenta, red, blue, 34,56,75, 78,56,35"
The line chart widget does not include marker lines. However, the bounds of the widget effectively define the plotting area, and the y = 0 line is a virtual horizontal line that goes exactly through the middle of the widget. The plotting area gets automatically hidden or shown when switching from reader to author level.
This pie chart widget can plot up to 6 different values. The various buttons on this page change properties of the widget.
Set plotValues of the group to up to 6 numbers. The numbers will be automatically normalized to add up to 100%. You can use any number of values but at least 2 and no more than 6 (to show more values, see below.)
Example: set plotValues of group "Chart One" to "1000, 2000, 4000, 2000"
Note that the chart will still be plotted correctly even if it is not perfectly round. However, since the size of the pies is calculated by angle, not by surface, this can lead to a distorted view of the data.
Set plotOrigin of the group to a value in degrees which must be a number from 0 to 360.
Example: set plotOrigin of group "Chart One" to 45
Note: The chart gets redrawn with the current values when you change the plotOrigin .
Set plotColors of the group to up to 6 HLS color values or color names.
Example: set plotColors of group "Chart One" to "green, magenta, red, blue, 34,56,75, 78,56,35"
To plot more than 6 values, select the group, double-click it to select one of the pie objects inside, and use the clipboard to copy and paste as many copies of the pie object as you need inside the group. Set the color of the pies as you go, or set the plotColors property to your liking. Note that adding pies to this widget will slow it down..
.'+ +F
.'+ +F
Chart One
plotOrigin
buttonUp
plotOrigin
"Chart One"
Chart One
Claude
authorName
startangle
false
fullpie
zeroAngle
6083, 4186, 5092, 9511, 3934, 3375
defValues
1540.5
vRadius
yCenter
2287.5
xCenter
PieChart
tbk_wid_name
PlotValues
PlotOrigin
PlotColors
tbk_wid_props
tbk_wid_values
myPlotOrigin
magenta,cyan,yellow,red,blue,green
myPlotColors
plotValues
chart one
buttonUp
-%, #>
buttonDoubleClick
plotValues
"chart one"
Zdata
(5) + 1
6083, 4186, 5092, 9511, 3934, 3375
plotValues
chart one
buttonUp
buttonDoubleClick
plotValues
"chart one"
Zdata
(5) + 1
(10)
10,6,1,7,10
plotValues
chart one
buttonUp
buttonDoubleClick
plotValues
"chart one"
Zdata
(5) + 1
(10) / 10
%" 0.0"
0.9, 0.9, 0.5, 0.6, 0.8, 0.2
chart one
plotOrigin
buttonUp
plotOrigin
"chart one"
chart one
plotOrigin
buttonUp
plotOrigin
"chart one"
chart one
plotOrigin
buttonUp
plotOrigin
"chart one"
chart one
plotOrigin
buttonUp
plotOrigin
"chart one"
chart one
plotOrigin
buttonUp
plotOrigin
"chart one"
plotColors
blue,red,green,magenta,cyan,yellow
chart one
buttonUp
plotColors
"chart one"
Color Scheme 1
plotColors
magenta,cyan,yellow,red,blue,green
chart one
buttonUp
plotColors
"chart one"
Color Scheme 2
color2
Exploding Pie
label
Exploding Pie
This pie chart shows two values only. One of the values gets plotted as an "exploded" wedge. The animation examples simply set properties of the widget.I
Set plotValues of the group to two numbers. The numbers will be automatically normalized to add up to 100%. The second number will be shown in the "exploded" slice.
Example: set plotValues of group "Chart One" to "10000,2000"
Note that the chart will still be plotted correctly even if it is not perfectly round. However, since the size of the pies is calculated by angle, not by surface, this can lead to a distorted view of the data.
Set plotOrigin of the group to a value in degrees which must be a number from 0 to 360, and a second number specifying the distance (in ToolBook units) by which to move the exploded slice.
Example: set plotOrigin of group "Chart One" to 45, 150
Note: The chart gets redrawn with the current values when you change the plotOrigin.
Set plotColors of the group to HLS color values or color names for the two slices.
Example: set plotColors of group "Chart One" to "green, 78,56,35""""
Chart One
B cE
Degree 45
explodeBy
Claude
authorName
startangle
false
fullpie
zeroAngle
Degree 0
defValues
1540.5
vRadius
yCenter
2287.5
xCenter
ExplodedPieChart
tbk_wid_name
PlotValues
PlotOrigin
PlotColors
tbk_wid_props
tbk_wid_values
blue,red,green,magenta,cyan,yellow
myPlotColors
plotValues
chart one
plotOrigin
buttonUp
plotValues
"chart one"
plotOrigin
150,240
plotValues
chart one
buttonUp
plotValues
"chart one"
chart one
plotOrigin
buttonUp
plotOrigin
"chart one"
chart one
plotOrigin
buttonUp
plotOrigin
"chart one"
chart one
plotOrigin
buttonUp
plotOrigin
"chart one"
plotColors
blue,red,green,magenta,cyan,yellow
chart one
buttonUp
plotColors
"chart one"
Color Scheme 1
plotColors
magenta,cyan,yellow,red,blue,green
chart one
buttonUp
plotColors
"chart one"
Color Scheme 2
.'+ +F
.'+ +F
Chart One
plotOrigin
buttonUp
plotOrigin
"Chart One"
.'+ +F
.'+ +F
false
Chart One
plotOrigin
buttonUp
odone
plotOrigin
"Chart One"
i,i*2
false
Animate
.'+ +F
.'+ +F
explodeAngle
false
Chart One
plotOrigin
plotOrigin
buttonUp
odone
explodeAngle
plotOrigin
"Chart One"
Animate
Values 10 to 1
Values 2 to 1
Degree 90
Animate 1
Animate 2
Color Scheme 1
Color Scheme 2
ASYM_BeenHere
Sliders
label
Sliders
horizSlider
sldrPosition
tbk_wid_name
horizSlider
centered
txClassName
HSliderThumb
vertSlider
sldrPosition
tbk_wid_name
vertSlider
txClassName
VSliderThumb
Slider with graphic button
Slider with line endbutton
These widgets demonstrate how to make graphical sliders.
The baseball slider uses a resource of the book; the pointer slider uses a line end.
ASYM_BeenHere
Ratchet
label
Ratchet
slider
tbk_wid_name
slider
,&H.&
1,"JRY
,&H.&
slider
buttonDown
-- This handler jumps the slider
each tick mark
mouse
moved
Zarray x[5], pin[4]
i] = (((
U(i+1))-(
Ui))/2 )+(
x[i] = (
Ui)-82
pos =
" = x[1]
" = x[2]
" = x[3]
When
" = x[4]
" = x[5]
slider
emitting_Slider
tbk_wid_name
emitting_Slider
slider@
,&H.&
1,"JRY
,&H.&
slider
buttonDown
-- This handler jumps the slider
each tick mark
mouse
moved
Zarray x[5], pin[4]
i] = (((
U(i+1))-(
Ui))/2 )+(
x[i] = (
Ui)-82
pos =
" = x[1]
" = x[2]
" = x[3]
When
" = x[4]
" = x[5]
slider2
track
These ratchet sliders constrain the user's choices to certain values.
Each widget allows itself to be set only at the hash marks. The user doesn't have intermediate values available, and this fact is reinforced by the visual feedback. The widget below also reports what mark it has been set to.set to.
Face Plate 2
Back Plate 2
Face Plate 1
Back Plate 1
ASYM_BeenHere
l!Z!u4
Scale Slider
label
Scale Slider
slider
mySliderMin
mySliderMax
mysliderPos
myNumTics
tbk_wid_name
scaledSlider
tbk_wid_props
numTics
tallTicSpacing
sliderMin
sliderMax
sliderPos
tbk_wid_values
myTallTicSpacing
thumb
txClassName
hSliderThumb
glide
button id 103 of page id 15
width
hilight
false
myTrackPos
helptext
Shuttle
Button
10.566666666666673
200033333333333344
30.50000000000001e-014
40006666666666669
50.53333333333336
60000000000000001
10000
emitter
#00.00
sliderMove
notifyAfter sliderMove pos
arbitrary precision, comment the
adjust
zeros
tpoint
%"#00.00"
integers
tbk_wid_name
scale_emitter
50.00569620253169
startSliderMove
sliderMove
endSliderMove
sliderMove
A sophisticated slider with a number of properties you can edit.
The slider widget sends the following messages:
startSliderMove: sent when the user first clicks on the thumb
sliderMove: sent constantly as the slider is being dragged
endSliderMove: sent when the user releases the thumb.
Each of these messages includes the current position of the slider thumb as its parameter.
You can set or get the following properties of the slider.
sliderMin: Minimum value for the slider
sliderMax: Maximum value for the slider
sliderPos: Position of the thumb
numTics: Number of tic marks that appear on the scale (max 50)
tallTicSpacing: Frequency of tall tics on the scale. Each tall tic has a label below it. (up to 11 labels)
These properties are easily accessed through the property browser.owser..in the tools30.sbk.
ASYM_BeenHere
Calculator
label
Calculator
Calculator
tbk_wid_name
Calculator
memory
buttonClick
buttonClick
4memory
display
memory
last_key
buttonClick
buttonClick
4last_key, memory
"display" --
display
last_key
memory
buttonClick
buttonClick
4memory, last_key
"display"
"mr"
display
memory
last_key
buttonClick
buttonClick
4last_key, memory
"display" --subtract
calculate
buttonClick
buttonClick
calculate (
LBdisplay
buttonClick
buttonClick
display (
decimal
clear
display
last_key
buttonClick
theStore
buttonDoubleClick
buttonClick
4last_key
"display"
Jkeystroke
4theStore, op
--initialize
temp value
operator
plusminusbtn
display
buttonup
"display"
* (-1)
display
buttonClick
buttonDoubleClick
buttonClick
09011997480157360e+036
A ten-key style calculator with memory.
ASYM_BeenHere
A regular old calculator, works great.
functions
a question widget) when an object that has the ASYM_Draggable property set to TRUE is dragged.
Widget Properties
(not all properties are valid for all question types)
PROPERTIES
VALUE
PURPOSE
ASYM_WID_AnsArray
Array
Contains all of the response definition data for the question. (see below)
ASYM_WID_AnswerLocked
Specifies whether the questL
Validate Text, 2
label
ASYM_BeenHere
Validate Text, 2
These widgets validate the text after each keystroke..
The widget fields will only accept data of the type described in the fields to the left of the widgets. The test is made after each keystroke. The pattern for the first widget is a user property.
This script will force a recordfield's scrollbar to automatically appear when necessary. Note the difference between this script and the script for "Auto-scroll field." A recordfield resides on the background, but must be referred to by page, so we have to massage the object reference.from
to handle showOrHideScrollbar
get self
obj = words 1 to 3 of it
if textOverflow of obj > 0 or scroll of obj> 0
oldBorder of obj = borderStyle of obj
set borderStyle of obj to scrolling
else
if oldBorder of obj = NULL
oldBorder of obj = borderStyle of obj
end
set borderStyle of obj to oldBorder of obj
end if
notifyBefore enterPage
send showOrHideScrollbar
notifyAfter leaveField
send showOrHideScrollbar
notifyAfter keyUp
send showOrHideScrollbar
notifyAfter paste
send showOrHideScrollbar
notifyAfter cut
send showOrHideScrollbar
notifyAfter clear
send showOrHideScrollbar
"hideControls
helpTemplate
reader
<All topics>
Using this &Template
displayBitsPerPixel
Displays help on using this template.
categories
getDC
releaseDC
lighterBlue
Topics
false
tb40win.dll
darkerBlue
getDeviceCaps
moveTo
lineTo
setROP2
createPen
deleteObject
selectObject
navigationBar
backcolor
Tvpopulate
numColors
enterApplication
helpTemplate
leaveApplication
CshowControls
author
1,"J<Y
topics
CategoryButtons
Navigation
showControls
"hideControls
reader
topics
CategoryButtons
Navigation
hideControls
itemOffset
description and script,description and example,description only
pageID
categoryStruct
categoryStruct
destroy
.', "
subTopicName
description and script,description and example,description only
scrolling
explanation
label
enterPage
subTopicName
description and script,description and example,description only
label
topic
label
leavePage
extractName
extractID
,&H.&
itemOffset
stripChar
}releaseDC
4getDeviceCaps
getDC
retval
numColors
Q@darkerBlue
R@lighterBlue
bckgrnds
intro,description and script,description and example,description only
curBack
backColor
categoryStruct
showCategoryStruct
stbk_noSwap
|CtwoDquicksrt
twoDquicksort
stbk_noSwap
|CtwoDquicksrt
twoDquicksrt
.', "
Cannot find book TMPLHELP.TBK
mydir
tmplhelp.tbk
helpTemplate
author
reader
author
zashowOrHideScrollbar
enterpage
zashowOrHideScrollbar
leaveField
zashowOrHideScrollbar
keyUp
zashowOrHideScrollbar
paste
zashowOrHideScrollbar
zashowOrHideScrollbar
clear
reader
showOrHideScrollbar
obref
dlgPage
-nameRef
Scripts cannot be viewed when using the runtime version of Multimedia ToolBook.
intro,description and script,description and example,description only
pageRef
wsortTextLines
tb40dlg.dll
backRef
label
populate
extractID
navigationbar
buttonclick
Useful Patterns
label
ASYM_BeenHere
Useful Patterns
These widgets recognize data entered in a standard pattern of numbers..
Here are two widgets ready to go into your application. They both validate the data on keystroke, the first will only accept a valid social security number, the second a valid telephone number...
You can move information back and forth between these two fields. You can also drag the text back and forth.
Like the old Macintosh Font/DA mover, you can use this control to move information back and forth between a source field and a destination field.
ASYM_BeenHere
Directories and Files
label
ASYM_BeenHere
Directories and Files
These fields can navigate to and display information from your DOS directories.
These five widgets provide a way to move around in the DOS file system. Changing items here actually changes what drive you are logged onto and what directory is current.
&Directories
directories
directories
tbk_wid_name
CLIPART
SAMPLES
SETUP
SPCLST
TOOLS
TUTORIAL
WIDGETS
WINAPI
GENI_SP1
KIDSOFT
MOUSE
MSOFFICE
MSWORKS
MTB30
PERSONAL
POWERPNT
PRODIGY
PSDWIN
QUICKENW
UTILITY
WINCAKE
WINDOWS
WINFAX
WINWORDS
INPUT
INSTVER
LISTHORZ
LOWPASS
MACROHLP
MAKEAPP
MCITEST
MEMORY
MIDIMON
MULTIPAD
MUSCROLL
MYPAL
MYSCRIB
OUTPUT
OWNCOMBO
OWNERB
PALETTE
PENCNTL
PENPAD
PRNTFILE
PROFILER
QWGDEMO
REVERSE
ROTARY
SELECT
SHOWDIB
SHOWGDI
SNOOP
SORTDEMO
SRVRDEMO
TDOSMEM
TIMERS
TOOLHELP
VERSTAMP
WINMEM32
WMFDCODE
XTENSION
LAURELM
HOURIR
BRIANT
CHARLESO
ERIKR
FRANKL
DICKE
BRUCEL
MIYUKIH
JOHNJ
SARAHV
TRANSFER
CHARLES
CHRISC
CHUCKW
CLAUDE
STEVEW
CATHYS
ALLANF
LENORAF
CRAIG
JOHNCO
DANNS
DARLENEM
DAVEH
KEVINB
LINDAA
DAWNM
DEBBIE
INGRIDF
DENNISO
STEVET
GIGIL
DOUGY
TERRYL
WHITEY
SCOTT
MIREIZ
LORIJ
CHARLESC
TAMMYH
AUSTRIA
MITCHELL
SWISS
SAVER
DENNISC
DOUGK
EPOCH
SCOTTM
MIKEF
GER_CPL
ELAINER
MELODY
JOHNGO
SCOTTSC
GREGE
HARRIETL
HARRYS
CSC_TOM
JACKIEV
MIKEN
JEAND
JEFFA
JOELK
JEFFU
JENNIFER
WHITNEYM
JEREANG
DICKH
JANETS
RANDYA
JOHNA
JOHNB
JOHNC
JOHNG
JOHNT
JONES
JORDANS
JOSEPHB
JOSHB
JULIE
KATHERIN
KEITHC
YVETTEB
DIDIERB
LANCE
LAURELC
LISAA
CSC_TAMY
LORIP
WAYNEW
MARCS
MARIEF
BETHR
MARKMA
MARTY
KIKIW
RICKS
BRIANH
MICHAELS
JEFFM
DEBBIEP
MIKEM
MOUSE
NADIMH
NANETTE
NORMS
PAULD
PAULG
PAULM
PHILP
LOGOS
DENNISL
RICKE
MICHELEC
DIANED
ROSSG
ROSSH
CHARLOTT
SCREENS
SHABBIR
LISAM
SARAHH
SHELLEYH
SHERRI
SHIRLEY
SHUANGL
SKUSALES
STEVEB
STEVEBA
STEVEBEC
STEVENW
SUSAND
SUSANM
SUZYS
MARKR
TERONU
TRACEY
TRAINING
TYLERB
SCOTS
WHOWHERE
WINNIE
TONYA
SUSANP
DAVIDS
SYPLUS
JOHND
DALEW
JENNW
JULIEP
BETHH
PRODUCTI
MIKES
MARGOTP
MICHAELO
STEVEC
JANETL
LYNNEP
TYRONEF
MIKEST
KRISTINE
BILLS
SANDYW
GAARL
MIKEP
BRADC
SUSANH
STEPHEN
STEVEF
D&rives
Drives
Drives
tbk_wid_name
Fi&les
file list
file list
tbk_wid_name
ANIMALS.WAV
ANIMATE.ICO
ANIMATE.TBK
ASYM01.AVI
AUTOEDIT.EXE
AUTOEDIT.ICO
BROWSER.EXE
BROWSER.ICO
CARHORN.WAV
CBT_DEMO.AVI
CBT_DEMO.ICO
CBT_DEMO.TBK
CBT1.TBK
CBT2.TBK
CBT3.TBK
CBT4.TBK
CHIRP.WAV
COMPANY.NDX
CONTACT.DBF
CONTACT.ICO
CONTACT.TBK
DBEXCHNG.ICO
DBEXCHNG.TBK
DIALOG.HLP
DIALOG.ICO
DIALOG.TBK
FEATURES.ICO
FEATURES.TBK
HANDBOOK.ICO
HANDBOOK.TBK
HANDBOOK.TXT
LIBRARY.ICO
LIBRARY.TBK
MAPI.ICO
MAPI.TBK
NAME.NDX
POP.WAV
POPIN.WAV
SAMPLES.HLP
SCRAPBK.ICO
SCRAPBK.TBK
TAQUIN.BMP
TAQUIN.ICO
TAQUIN.TBK
TMPLHELP.TBK
VAULT.WAV
WHOWHERE.DB
WHOWHERE.ICO
WHOWHERE.MB
WHOWHERE.PX
WHOWHERE.TBK
WIDGETS.ICOTS.ICOD30.HLP
MTB30.ATS
MTB30.EXE
MTB30.HLP
MTB30.SBK
MTB30ANM.SBK
MTB30BAS.DLL
MTB30BMP.DLL
MTB30CBT.DLL
MTB30CMP.DLL
MTB30CVT.DLL
MTB30EDT.DLL
MTB30FLT.DLL
MTB30LNL.DLL
MTB30MM.DLL
MTB30MM.INI
MTB30MM.SBK
MTB30NET.EXE
MTB30RED.DLL
MTB30RUN.EXE
MTB30UTL.DLL
MTB30XTR.DLL
MTBPREFS.EXE
PALED30.EXE
PALED30.HLP
PARADOX.ATS
PATHANIM.HLP
PCDLIB.DLL
PCDXBMP.DLL
PHOTO.DLL
PRINTWND.SBK
PXENGWIN.DLL
REFSHELF.EXE
RELNOTES.HLP
RELNOTES.WRI
SCRNCAMP.EXE
SCRNCAMP.TXT
SCRWALK.ICO
SCRWALK.TBK
SYSINFO.EXE
TB30DB3.DLL
TB30DLG.DLL
TB30DOS.DLL
TB30PDX.DLL
TB30WIN.DLL
TB30XTR.DLL
TBKDB3.DLL
TBKDLG.DLL
TBKFILE.DLL
TBKSHELF.EXE
TBKWIN.DLL
TBLOAD.EXE
TEST.EXE
TEST.TBK
THUMB.SBK
UTILS.ATS
VEAMAA51.LEX
WAVEED30.EXE
WAVEED30.HLP
WINCOMT.DLL
WINCONST.HLP
WRAPBAR.DLL
WRKBNCHT.DLL
Current Directory
CurrentDirectory
w, #>
vgetcurrentDirectory
getCurrentDrive
drive
updateDirectoryInfo
notifyBefore updateDirectoryInfo path
drive = getCurrentDrive()
&":\"&getcurrentDirectory(
CurrentDirectory
tbk_wid_name
D:\MTB40\SAMPLESETRIND1\PROBLEMDOSST\RESWDLGCK
File Name
file name
file name
tbk_wid_name
ANIMATE.TBKE
updateDirectoryInfo
updateFileInfo
acceptFile
enterpage
selectFile
updateFileInfo
updateDirectoryInfo
selectFile
activateInstance
Time and Date
label
ASYM_BeenHere
Time and Date
These fields display the current date and time.
AutoDate and AutoTime initialize themselves on the enterPage message with a notifyBefore handler. You can get and set the formats in which they show the date and time with any legal OpenScript time format. The widgets will set their default format and immediately update. For example, type the following script in the Command window: set format of field "autoDate" to "dd/mm/yy".
autoDate
format
enterPage
prop_format
format
prop_format
format
notifyBefore
value
oprop_format
sendnotifyBefore
autoDate
tbk_wid_name
format
borderStyle
tbk_wid_props
list,none,rectangle,shadowed,inset,raised
tbk_wid_values
mm/dd/yy
prop_format
09/07/9520, 1993
autoTime
autoTime
tbk_wid_name
format
borderStyle
period
tbk_wid_props
list,none,rectangle,shadowed,inset,raised
tbk_wid_values
h:min:sec AMPM
prop_format
period
timerID
8:45:01 AMM
Auto date:nameer
Auto time:nameer
enterPage
leavePage
International Time and Date
label
ASYM_BeenHere
International Time and Date
These fields display the current date and time in the current international format.
These widgets are just like the "Auto Date" and "Auto Time" widgets except that they determine their formats by referring to the sysIDate and sysITime international system properties.operties.
autoDate
myDate
dd/mm/yy
yy/mm/dd
mm/dd/yy
enterPage
notifyBefore
myDate =
sysIDate
%"dd/mm/yy"
%"yy/mm/dd"
%"mm/dd/yy"
autoDate
tbk_wid_name
format
borderStyle
tbk_wid_props
list,none,rectangle,shadowed,inset,raised
tbk_wid_values
mm/dd/yy
prop_format
05/26/9540, 1993
autoTime
period
SetTimer
widTimerStart
KillTimer
widTimerEnd
hfwidTimerStart
clockTick
:timerID
enterPage
widTimerEnd
:timerID
leavePage
hh24:min:sec
clockTick
h:min:sec
:timerID
clockTick
notifyBefore
linkDLL "user"
WORD widTimerStart=SetTimer(
,DWORD)
+End = KillTimer(
translateWindowMessage
windowhandle
on 0x0113
clockTick
otimerID
operiod * 1000, 0)
notifyAfter
widTimerEnd(
unlinkDLL "
hWnd, msg,
sysITime = 1
%"hh24:
j:sec"
autoTime
tbk_wid_name
format
borderStyle
period
tbk_wid_props
list,none,rectangle,shadowed,inset,raised
tbk_wid_values
h:min:sec AMPM
prop_format
period
timerID
3:52:015PMM
International date:
International time:
enterPage
leavePage
Calendar
label
ASYM_BeenHere
Calendar
A calendar that keeps itself current.
This widget automatically shows the current date, and can be set to show any month in the years 1700 to 2100. Enough functionality is provided to make the scripts easily extensible.
calendar
calendar
tbk_wid_name
field "27"
resetObj
frame
calYear
HSbuildcal
frame
whatDate
sCurrentMonth
m d y
sCurrentYear
selectChange
selectChange whatText
4sCurrentMonth, sCurrentYear
whatDate =
%"m d y"
= TRUE
buildcal
"frame"
= FALSE
d 1700
calMonth
HSbuildcal
frame
whatDate
sCurrentMonth
m d y
sCurrentYear
selectChange
selectChange whatMonth
4sCurrentMonth, sCurrentYear
whatDate =
%"m d y"
= TRUE
buildcal
"frame"
= FALSE
Mayober 109yy
January 1
February 2
March 3
April 4
May 5
June 6
July 7
August 8
September 9
October 10
November 11
December 124
today
HSbuildcal
m,d,y
displayDate
sCurrentDay
sCurrentMonth
mydate
sCurrentYear
buttonClick
buttonClick
4sCurrentMonth, sCurrentYear, sCurrentDay
mydate =
%"m,d,y"
= TRUE
displayDate
buildcal
= FALSE
Field id 83 of Page id 2
lastObj
strokcolor
strokcolor
enterPage
Get Printer Resolution
label
ASYM_BeenHere
Get Printer ResolutionA
Windows allows us to learn about the way a device displays information by creating an "Information Context". We use the API calls "createIC" and "getDeviceCaps" with the name of the printer (retrieved from the win.ini). This method is capable of finding out just about anything you want to know about your printer or your display monitor.
to handle buttonClick
get printerRes()
if it <> null
request "This printer has a resolution of" && \
item 1 of it && "by" && item 2 of it && "dots per inch."
This script can retrieve and display the version numbers for DOS and Windows. The Windows call GetVersion returns the running versions of Windows and DOS in a packed format. This script makes the link, makes the call, and unpacks the information for you, displaying it in a readable form.
This script distinguishes between Windows 3.1 and Windows for Workgroups. It checks to see if a driver necessary for Windows for Workgroups is loaded (wfwnet.drv), in order to determine which version of Windows is running. running.
to handle buttonClick
linkDLL "kernel"
WORD getModuleHandle (STRING)
end linkDLL
if getModuleHandle("wfwnet.drv") is NULL
request "Running Windows"
else
request "Running Windows for Workgroups"
end if
unlinkDLL "kernel"
end buttonClickkkk
Outline
label
ASYM_BeenHere
Outline
Use this widget to create a field you can use as an outline at Reader level.
At Author level, you can set the level of the text in the outline by typing Ctrl+Tab. When the outline field is copied and pasted into another book, it retrieves the resources for the plus and minus bitmaps from the first book.
outline
Big green dogs
Great Dane
So-so Danes
Lesser Danes
Collie
Doberman
Small dogs
Sheltie
Wiener dog
Froo froo dogs
Chow
Chihuahua
Poodle
Lap poodle
Yappy poodle
Snapping poodle
Shitzu
Cartoon Cats
Hobbes
Bill
Fritz
Presidential Cats
Socks
Bill
source
outline
tbk_wid_name
Book "D:\ARNOLD\OLDAPPS\LIBRARY.TBK"
oldBook
Dogs
Big green dogs
Small dogs
Froo froo dogs
Cats
Cartoon Cats
Presidential Cats Sheltie
Wiener dog
Froo froo dogs
Chow
Chihuahua
Poodle
Lap poodle
Yappy poodle
Snapping poodle
Shitzu
Cartoon Cats
Hobbes
Bill
Fritz
Presidential Cats
Socks
Bill
enterPage
author
reader
Book "D:\MTB35\SAMPLES\LIBRARY.TBK"
Outline Rearranger
label
ASYM_BeenHere
Outline Rearrangera
You can move individual textlines or whole sections, by dragging the textlines in the field.
Tabbed textlines can be dragged up or down, and whole sections can be moved by dragging the textline at the head of a section. The indicator is an obscured line with a line end on it. There is a field covered by the main field, and we use the bounds of a hotword in the hidden field to find the height of a line of text..
Outline_Rearranger
lineheight
hotfield
outfield
outline_rearranger
sizeSample
adjustsize
sized
enterpage
reader
-- initialize the
sized
hotfield
"sizeSample"
outfield
"outline_rearranger"
ypix
sysPageUnitsPerPixel
syssuspendmessages
adjustsize
ylineheight
o,3)
notifybefore
notifyAfter
Outline_Rearranger
tbk_wid_name
sizeSample
sizeSample
outline_rearranger
Frame Animation
Introduction to Frame Animation
Page Flipping
Hiding and Showing objects
Moving Objects
Move By
Move To
The Position Property
Useful Scripts
Simulating Gravity
Timing Animation
Animating with Resources
Simulating a Good 5 Cent Cigar
Simulating a Good 5 Cent Cigar To
The Position Property
Simulating Gravity
Timing Animation
Simulating a Good 5 Cent Cigary
Timing Animation The Position Property
Moving Objects
Move To
Move By
marker
vertLoc
vertLoc b
value
ypix =
syspageunitsperpixel
halfH
B- 3*
reader
terpage
enterpage
Max Select Field
label
ASYM_BeenHere
Max Select FieldE
This widget limits the number of selectable lines in a multi-select list box.
The handler can be placed in a system book or in the book or page script so it will work with more than one multi-select list box. It takes one parameter, Num, which represents the maximum number of selections allowed.
To call the maxSelection handler use the following syntax:
to handle buttonClick
send MaxSelection 3
end buttonClick
MaxSelect
MaxSelect
tbk_wid_name
One One One
Two Two Two
Three Three Three
Four Four Four
Five Five Five
Ex Select Field
label
ASYM_BeenHere
Ex Select Field
The Ex Select widget allows for an exclusive selection, acting like a single-select list box inside a multi-select list box.
The XSelect handler allows multiple selections in a list box as long as the specified line is not selected. Once the specified line is selected, all other lines in the list box are unselected.
This handler can be placed in a system book or in the book or page script, so it will work with more than one multi-select list box.
The handler takes one parameter, XLine, which represents the line to make exclusive.
To call the Xselect handler use the following syntax:
to handle buttonClick
send Xselect 5
end buttonClickkkk
XLine
Ex Select
tbk_wid_name
One One One
Two Two Two
Three Three Three
Four Four Four
FiveFiveFive
f 1992 is a leap year.
-- if leap
itemOffset()
origPage
original
itemOffset()
label
itemOffset()G
A fast way to find the offset of an item in a list. For example, itemOffset("e","a,b,c,d,e,f,g") would return "5"
Handlers: itemOffset (<item>,<list>)
Parameters:
<item>: The item whose offset you are looking for.
<list>: The list in which you are looking.
Note: to find out if the item is in the list, check if itemOffset is greater than 0.....
-- finds the offset of an item in a list.
to get itemOffset itm,lst
step i from 1 to itemcount(lst)
pop lst
if itm = it
return i
end
return 0
enddddddddddddddturn 0
ASYM_BeenHere
Display 2-D array values
request2Darray
request2Darray x[][]
Zretval
dimensions(x)
x[i][j]
origPage
original
Display 2-D array values
label
Display 2-D array values
Often, when debugging a script using arrays, you may want to display the array at a certain point in your script. This page has a handler for displaying the contents of two-dimensional arrays.
Note that this also displays a standard method for walking through a 2D array.
The button to the right fills an array with the elements of the list in the field.
Once filled, it passes the array to the request2Darray handler (in this page script), which displays the contents of the array..ray.
arrayField
d,4,4/1/06
h,7,4/1/23
j,5,3/1/29
i,1,1/9/55
g,6,7/7/64
e,9,11/13/66
f,0,7/4/76
b,3,5/23/91
c,2,3/11/92
a,8,1/12/933
Display
krequest2DArray
arrayField
buttonClick
buttonClick
Zx[][]
fill x
"arrayField"
] order
request2DArray x
Display
ASYM_BeenHere
Add number of days to date
Add number of days to date
This handler adds a specified number of days to a provided date. Note that a negative number of days can be supplied to subtract a number of days.
Handler: newDate (<original date>,<days to add>)
Parameters:
<original date>: Base date to which you want to add days
<days to add>: Number of days you want to add to <original date>
Returns the modified date.
-- function: newDate(<original date>,<number of days to add>)
-- Returns a date n days from a given date. Pass it a date
-- for the first parameter, followed by an integer (positive
-- or negative) representing the number of days from that date
-- Example: to find out the date 10 days ago
-- set x to newDate(sysdate,-10)
to get newDate origdate, days
format date origdate as "seconds"
increment origdate by (days*24*60*60)
format date origdate as sysdateformat from "seconds"
return origdate
endddddddddddddddddddddddddddddddddddddddddd
origPage
original
Add number of days to date
label
ASYM_BeenHere
95051000165214669364226072
ASYM_TpID
Controlling volume of clips
label
ASYM_BeenHere
Controlling volume of clips
Clips have a property called mmVolume, which you can set before or during play of a clip. This example uses a dial widget to control the volume of a clip. The dial widget sends out a dialMove message, which the Play Clip button handles..with a no
Choose a clip, then play it while turning the dial to control the volume...
Play Clip
Play Clip
Clip to play
Clip Chooser
CdresetContents
enterpage
CdresetContents
clips
whatClip
resetContents
notifyBefore
resetContents
notifyAfter
[dropdownitems
clips = resourceList(
<> NULL
whatClip
&CRLF
r"&"E&
dropDownItems
clip "Asymetrix Logo"
clip "Asymetrix Logo"
clip "bird1"
clip "bird2"
clip "bird3"
clip "CD Audio"
clip "Chirp"
clip "lion"
clip "No No No"
clip "tiger"
clip "toad"
myStartAngle
myendAngle
myTallTicSpacing
scaleDial
tbk_wid_name
dialPos
dialMin
dialMax
startAngle
endAngle
numTics
tallTicSpacing
tbk_wid_props
tbk_wid_values
myNumTics
mydialMin
mydialMax
&!V!i
myRotation
struct
structInfo
40433333333333333
605.6666666666667
808t[#
10099999999999999
854t+$
100t;%
96199999999999999
Display
dialMove
notifybefore dialMove pos
100639676273476528
&=a*'
enterpage
dialMove
Aaz'n
dialMove
enddialMove
description only
description and example
topicName
description and script
Untitled
enterpage
pageName
templateButtons
label
subtopicname
topicName
chosen
cancel
keychar
cancel
-- initialize dialog box
"Untitled"
"topicName"
B"description
buttonclick
-- sent
user presses OK
pageName
chosen
"templateButtons"
--
the specified
label
"subtopicname"
close
-- handles OK
escape
keyEnter
origPage
original
label
ASYM_BeenHere
in,false
ThreeDeeRect
bottomLine
topLine
Topic name:
bottomLine
topLine
topicName
Description and Example
templateButtons
chosen
templates
buttonclick
buttonclick
-- store selected
a property
chosen
"templates"
Description and Script
chosen
Description and Script
Description and &Script
Description Only
Description &Only
Description and Example
Description and &Example
Choose Template
templates
Description and script
This is a description. Blah, blah, blah. Boy could I use another cup of Joe. Nothing is worse than work coffee.
to handle buttonup
do this
do that
description only
description and script
This is a description. Blah, blah, blah. Boy could I use another cup of Joe. Nothing is worse than work coffee. I've had so many cups of it already that I can see through time. Maybe some decaf is in orderrican butt.
Description and example
This is a description. Blah, blah, blah. Boy could I use another cup of Joe. Nothing is worse than work coffee. I've had so many cups of it already that I can see through time. Maybe some decaf is in order
to handle buttonup
do this
do that
buttonclick
buttonclick
cancel
buttonclick
buttonclick
Cancel
Untitleda web page
description and script
Get number of days in month
Get number of days in month
This handler returns the number of days there are in a month of a given year. Note that this handler requires the isLeapYear() handler, supplied below.
Handler: daysInMonth (<month>,<year>)
Parameters:
<month>: An integer representing the month
<year>: A four-digit year
Returns the number of days in the supplied month for that year.
-- NOTE: this function requires 4 digits for the year.
-- This function calls the function leapYear() defined below.
-- example: to find out how many days are in February, 1992
-- set x to daysInMonth(2,1992)
to get daysInMonth m,y
if m <> 2
return item m of "31,28,31,30,31,30,31,31,30,31,30,31"
else
if isLeapYear(y)
return 29
else
return 28
end
-- Returns TRUE if y is a leap year, FALSE if not.
-- NOTE: this fuction requires a four digit year.
-- Example: Find out if 1992 is a leap year.
-- if leapYear(1992)
to get isLeapYear y
if ((y mod 4 = 0 and y mod 100 <> 0) or (y mod 400 = 0))
return TRUE
else
return FALSE
origPage
original
Get number of days in month
label
ASYM_BeenHere
Create Full-Text Search Index
label
Create Full-Text Search Indexndex
Creates an index of the current book for full-text searches. The index will use the default settings file (found in the Multimedia ToolBook directory).
The index will be created in the same directory and have the same name as the the current book.
Example of use:
send buildIndexxxxxxxxxxxxxx
-- this handler builds a basic full-text search index of the current book.
to handle buildIndex
-- display an hourglass cursor... this can take a while.
sysCursor = 4
-- link the dlls required to build an index
linkDll "fts40mtb.dll"
STRING ftsRemoveIndex ( STRING )
DWORD ftsInitIndex ( STRING, STRING, WORD )
LONG ftsAddContext ( DWORD, STRING )
STRING ftsAddPage ( DWORD, STRING, STRING, STRING, LONG )
-- step through the list of fields and recordFields on this background
-- and add their text to the default section of the index
step j from 1 to itemCount(bgObs)
curObj = item j of bgObs
if object of curObj = "recordField"
-- to get the text of a recordField we have to refer to a page rather than the background
-- words 1 to 4 of a recordField reference are: "recordField id X of"
curObj = words 1 to 4 of curObj && pageRef
end
textExp = "richText of"&&curObj
get ftsAddTextToSection(indexHandle,textExp,"")
end
-- get a list of fields on this page and add their text to the default section of the index
pgObs = getObjectList(pageRef,"field",FALSE)
step j from 1 to itemcount(pgObs)
curObj = item j of pgObs
textExp = "richText of"&&curObj
get ftsAddTextToSection(indexHandle,textExp,"")
end
-- add the text placed into sections to the index
get ftsAddSectionsToPage(indexHandle)
--build the index
get ftsBuildIndex(indexHandle)
if it = NULL
request "Failed to build index."
else
request "Index successfully built."
send cleanExit
end buildIndex
-- this process will exit the build process cleanly
-- (removing the DLLs, etc.)
to handle cleanExit
sysCursor = 1
unlinkDLL "fts40mtb.dll"
break to system
end cleanExit
ASYM_BeenHere
{{{{{{{p{
wwwwwp
wwwwwp
wwwwwwp
wwwwwwwp
wwwwwwwp
wwwwwwwp
wwwwwwwp
wwwwwwwp
Perform Full-Text Search
label
Perform Full-Text Search
-- this handler performs a basic search procedure on a full-text search index
to get searchIndex queryString
system lastQuery
system DWORD numHits, currentHit
local pageRef
if queryString <> NULL
sysCursor = 4
-- link the functions required for the search
linkDll "fts40mtb.dll"
DWORD ftsOpenIndex ( STRING )
STRING ftsCloseIndex ( DWORD )
DWORD ftsQuery ( DWORD, STRING, DWORD )
STRING ftsMatchRef ( DWORD, DWORD, DWORD )
end
-- identify the index to search
indexName = name of this book
while "." is in indexName
clear last char of indexName
end
-- open the index
indexHandle = ftsOpenIndex(indexName)
if indexHandle = 0
request "Could not open index"
send cleanExit
return NULL
end
--make the query
numHits = ftsQuery(indexHandle,queryString,0)
if numHits > 0
-- there was at least one hit
if queryString = lastQuery
-- the user is searching for the same string as the last search
increment currentHit
if currentHit > numHits
currentHit = 1
end
else
currentHit = 1
lastQuery = queryString
end
-- get the page reference of the currentHit
pageRef = ftsMatchRef(indexHandle,currentHit,0)
end
-- close the index
get ftsCloseIndex(indexHandle)
send cleanExit
return pageRef
-- this handler exits the search process cleanly
-- (unlinking DLLs etc.)
to handle cleanExit
sysCursor = 1
unlinkDLL "fts40mtb.dll"
enddddd
get ftsCloseIndex(indexHandle)
send cleanExit
return pageRef
-- this handler exits the search process cleanly
-- (unlinking DLLs etc.)
to handle cleanExit
sysCursor = 1
unlinkDLL "fts30mtb.dll"
This handler performs a search using an existing full-text search index. The index is assumed to be in the same directory and have the same name as the current book.
This handler takes one parameter - the text for which to search - and returns a page reference for the first page on which that text appears. Searching with the same string again will return subsequent pages on which the text appears.
Example of use:
to handle buttonClick
system lastQuery
ask "Search For:" with lastQuery
queryString = it
pageRef = searchIndex(queryString)
if isObject(pageRef)
go to pageRef
else
request queryString&&"not found."
ASYM_BeenHere
Playing MIDI Directly
label
ASYM_BeenHere
Playing MIDI Directly
The button below plays MIDI sounds by making calls directly to the Windows Multimedia System DLL (mmsystem.dll)
Click and hold Play MIDI to play a MIDI sound.
Changing the Note field changes the note of the sound to be played.
Changing the Program field changes what instrument plays the note...
524480,14,25,25,138,134,,,Dialog,8,MS Sans Serif,,3,3,76,38,3596,1342177287,128,Keyboard Settings,0,,3,43,77,74,3599,1342177287,128,MIDI Settings,0,,8,55,37,10,3604,1342177280,130,Text,0,,8,70,37,10,3605,1342177280,130,Text,0,,8,86,37,10,3606,1342177280,130,Text,0,,8,101,37,10,3607,1342177280,130,Text,0,gliss,8,15,48,9,3602,1342242819,128,&Gliss,0,sustain,8,27,48,9,3603,1342242819,128,&Sustain,0,program,46,54,27,121,3608,1350631491,133,,0,volume,46,69,27,121,3609,1350631491,133,,0,channel,46,84,23,66,3610,1350631491,133,,0,device,46,99,23,44,3611,1350631491,133,,0,ok,85,8,47,13,1,1342242817,128,OK,0,cancel,85,24,47,13,2,1342242816,128,Cancel,0
dlgBox
gliss
sustain
program
volume
channel
device
Keyboard Help
keyboard help
buttonClick
buttonClick
"keyboard help"
Keyboard Help
Keyboard Help
buttonClick
buttonClick
By sending messages directly to the DLL, the user is given much more precision.
You can use the Ctrl key somewhat like the sustain pedal on a piano. Pressing Ctrl+Shift when you click a key acts as a MIDI "panic button" and shuts off any keys that might be ringing.
You can set parameters by having the "reader rightclick" set to true and in reader mode using the Custom edit button on the right-click tool bar for any of the keys or the group "keyboard." If you are in author mode, you can set these same parameters from the property browser for the keyboard group. osing "Property Browser" from the Tools menu. the keyboard group and choosing "Property Browser" from the Tools menu.
customEdit
enterPage
reader
leavePage
author
Show all objects of page
label
Show all objects of page
The script below displays all objects on the current page regardless of whether they are in groups.
to handle showAll
show getObjectList(this page,null,false)
ASYM_BeenHere
Disabling task switching
label
Disabling task switching#
The script below allows you to turn on or off task-switching. When task-switching is on the user may not change tasks by using Alt+Tab, Alt+Shift+Tab, or Ctrl+Esc. They may still activate other windows by clicking on them.
To turn off task-switching:
set taskSwitching() to FALSE
To turn task-switching back on:
set taskSwitching() to TRUE
to set taskSwitching to LOGICAL mode
if mode
untranslateWindowMessage 0x0112 for sysWindowHandle
else
translateWindowMessage for sysWindowHandle
on 0x0112 send WM_SYSCOMMAND
end
to handle WM_SYSCOMMAND hWnd, wMsg, wp, lpLo, lpHi
if wp <> 0xF050 and wp <> 0xF040 and wp <> 0xF130
--SC_PREVWINDOW, SC_NEXTWINDOW, and SC_TASKLIST
forward to system
ASYM_BeenHere
QUICKENW
UTILITY
WINCAKE
WINDOWS
WINFAX
WINWORDS
INPUT
INSTVER
LISTHORZ
LOWPASS
MACROHLP
MAKEAPP
MCITEST
MEMORY
MIDIMON
MULTIPAD
MUSCROLL
MYPAL
MYSCRIB
OUTPUT
OWNCOMBO
OWNERB
PALETTE
PENCNTL
PENPAD
PRNTFILE
PROFILER
QWGDEMO
REVERSE
ROTARY
SELECT
SHOWDIB
SHOWGDI
SNOOP
SORTDEMO
Icon Resources
Save Text to a File (ASCII or RT
Search and replace in a string
Remove given char from string
Remove given char from stringg
This handler removes all instances of the specified character from the specified string.
Handler: stripChar(<character to strip>,<string to strip it from>)
Parameters:
<character to strip>: any single character
<string to strip it from>: the string from which to strip the character
Returns the stripped string...
-- removes all instances of chr from strng
to get stripChar chr,strng
set chrLoc to offset(chr,strng)
while chrLoc > 0
clear char chrLoc of strng
set chrLoc to offset(chr,strng)
return strng
stripChar
stripChar chr,strng
chrLoc
origPage
original
Remove given char from string
label
ASYM_BeenHere
Play clip on enter page
label
Play clip on enter page
-- notifies for showing and closing clips
notifyAfter enterPage
-- these scripts could go in any object
-- on the page or background
-- clipRef of this page would
-- already have the necessary reference
clipRef = clipRef of this page
if clipRef <> NULL
mmOpen clipRef wait
-- use this if the media is on a cd-rom
-- mmCue clipRef wait
-- show the first frame
mmPlay clipRef in stage "myStage" of this background
end enterPage
notifyBefore leavePage
clipRef = clipRef of this page
if (clipRef <> null) and (mmIsOpen of clipRef)
mmClose clipRef
end if
end leavePage
These scripts play a clip upon entering a page and close it upon leaving the page. You could paste these scripts into any object. The clip to be played is identified by a user-property of the page and the clip is played in a stage object of the background.
ASYM_BeenHere
Chirp
CD Audio
bird1
bird2
bird3
tiger
No No No
Asymetrix Logo
chirp.wav
animals.wav
animals.wav
animals.wav
animals.wav
animals.wav
animals.wav
animals.wav
asym01.avi
AutoPageName
Auto Page Name
label
ASYM_BeenHere
Auto Page NameI
This field automatically displays the current page name.
This widget field uses a notifyBefore enterPage handler to set the text of the field to the name of the page. In order to see the field update if you name a page, you must send the enterPage message, or navigate away from the page and then return to it.d then return to it.turn to it..
autoPageName
enterPage
notifyBefore
autoPageName
tbk_wid_name
tbk_wid_values
AutoPageName
enterPage
Auto Page Number
label
ASYM_BeenHere
Auto Page NumberE
This field automatically displays the current page number.and page name..
This widget field uses a notifyBefore enterPage handler to set the text of the field to the number of the page. It must be activated by an enterPage message.
autoPageNumber
enterPage
notifyBefore
autoPageNumber
tbk_wid_name
tbk_wid_values
enterPage
Auto Buttons
label
Previous
First
Auto ButtonsU
ToolBook automatically enables and disables these buttons. In the example below, they work on the page, but they should be pasted onto a background. ToolBook uses the same script and user properties to enable and disable these buttons depending on what page the buttons are on.
To get and to set handlers determine what page ToolBook navigates to when the button is clicked and the page the button is disabled on. The caption of the button is also the actual command.
Tools30.sbk includes information for widgets of this kind, and you can edit them from that sysBook.
Make sure tools30.sbk is a system book. Right-click the button, click the Custom edit button on the right-click tool bar (just left of the Help button), and then double-click the value for the property in the "Browser" that appears.t-click tool bar (just left of the Help button), and then double-click the value for the property in the "Browser" that appears.
AutoButtons
AutoButtons
tbk_wid_name
autoDisable Navigation button
tbk_wid_name
level
direction
disablePage
tbk_wid_props
list,background,book
list,Next,Previous,First,Last
tbk_wid_values
background
prop_level
direction
prop_disablePage
H ^ \
autoDisable Navigation button
tbk_wid_name
level
direction
disablePage
tbk_wid_props
list,background,book
list,Next,Previous,First,Last
tbk_wid_values
background
prop_level
direction
First
prop_disablePage
Previous
autoDisable Navigation button
tbk_wid_name
level
direction
disablePage
tbk_wid_props
list,background,book
list,First,Previous,Next,Last
tbk_wid_values
background
prop_level
direction
prop_disablePage
autoDisable Navigation button
tbk_wid_name
level
direction
disablePage
tbk_wid_props
list,background,book
list,Next,Previous,First,Last
tbk_wid_values
background
prop_level
direction
First
prop_disablePage
First
enterPage
ASYM_BeenHere
Tab Widget
label
ASYM_BeenHere
Tab Widget
This widget can display from 1 to 6 tabs as shown below.]
Pressing a tab sends the tabPressed message with the parameter of the tab number pressed. Currently, this message is handled in the widget; you'll have to forward the message if you want to handle it at the page or background.
The widget should resize gracefully no matter what you do. Use the Group editor to resize the individual tabs. All handlers are in the folder group script. You can set the properties of this widget in MTB40.sbk.
To change the number of tabs, set numTabs of the widget to a number between 1 and 6.
Note: To add more than 6 tabs, see comments in the folder group script.
To change the height of the tabs, set tabHeight of the widget to a number in page units. (Currently it's at 275.)
To change the selected tab without clicking the tab itself, set tabMode of the widget to the appropriate number.
To change the amount of space between each tab, set tabSpace of the widget to a number in page units.
To change the labels on the tabs, change the caption of the button in the tab group using the right-click menu.u.button in the tab group using the right-click menu.i
folder
mytabheight
myNumTabs
myTabMode
myTabSpace
tbk_wid_name
numTabs
tabHeight
tabMode
tabSpace
tbk_wid_props
tbk_wid_values
obtype
tabHighlight
tabLabel
obtype
tabHighlight
tabLabel
obtype
tabHighlight
tabLabel
obtype
tabHighlight
tabLabel
obtype
tabHighlight
tabLabel
obtype
tabHighlight
tabLabel
highlight
Content Buttons
label
Content Buttons
The buttons below act as a table of contents or an outline.
The chapter headings on the left recognize their associated pages. The "buttons" (they are actually fields) on the right navigate to the pages with those names. Use the following command in the Command window to use the field at the upper-right to set the two levels of the outliner: set makeOutline of group tableOfContents to text of field "outline". Type Ctrl+Tab to indent subordinate items below the top-level text.
outline
outline
tbk_wid_name
Poodles
Great Danes
So-so Danes
Siamese cats
Fussy cats
Decorator cats
Cats who love dogs
Gold fish
Silver fish
Sushiiiiiiiih sushihhhhhh
tableOfContents
tableOfContents
tbk_wid_name
Chapters
chapter1
Poodles
Great Danes
So-so Danes
topics
pageID
Dogse Animations
chapter2
pageID
Siamese cats
Fussy cats
Decorator cats
Cats who love dogs
topics
Catsng Objectsns
chapter3
Gold fish
Silver fish
Sushi
topics
pageID
FishsesScriptsls
chapter4
pageID
Chickens 26
Goats 25
topics
Farm Animals
chapter5
chapter5'
chapter6
chapter6
chapter7
chapter7
chapter8
chapter8M
Topics
topic1
pageId
Poodles cats 26 59
topic2
pageId
Great DanesShowing 253
topic3
pageId
So-so Danesatsanesouces 61
topic4
pageId
Cats who love dogs 62
topic5
pageId
Move To 57
topic6
pageId
Moving on Idle 64
topic7
pageId
Tonyc7r7[
topic8
pageId
Barbara8
topic9
topic9r8e
topic10
topic108
bracket
joiner
ASYM_BeenHere
Validate Numerical Data, 1
label
Validate Numerical Data, 1o
These widgets validate numeric data when the user leaves the field..
The widget fields will only accept data of the type described in the fields to the left of the widgets. The widget tests the data for the valid type when the user leaves the field.
LeaveField_Number
The value in the field must be a number.
leaveField
xisType(REAL,
"The value
must be a
LeaveField_Number
tbk_wid_name
034.344r
LeaveField_Integer
The value in the field must be an integer.
leaveField
x(isType(REAL,
k1) = 0)
"The value
must be
integer."
LeaveField_Integer
tbk_wid_name
-123.5.444444
LeaveField_PosNumber
The value in the field must be a positive number.
leaveField
x(isType(REAL,
"The value
must be a positive
LeaveField_PosNumber
tbk_wid_name
55.5444444444
LeaveField_PosInt
The value in the field must be a positive integer.
leaveField
x(isType(REAL,
k1 = 0)
"The value
must be a positive integer."
LeaveField_PosInt
tbk_wid_name
54345.5765444
Number:
Integer:
Positive Number:
Positive Integer:
bitamp
sequencer
overlay
animation
digitalVideo
cdAudio
photoCD
videoDisk
waveAudio
minus
minus
Validate Text, 1
label
ASYM_BeenHere
Validate Text, 1
These widgets validate text when the user leaves the field..
The widget fields will only accept data of the type described in the fields above the widgets. The widget tests the data for the valid type when the user leaves the field.
The first widget uses a pattern editable from the script. The third and fourth widgets use the sysDateFormat and sysTimeFormat.meFormat.
The characters in the field must all be in the alphabet.
leaveField
= 32
= 9))
< 65)
> 90
< 97)
> 122)
"The
must
alphabet."
LeaveField_Whitespace
tbk_wid_name
Foobar Barfoorrrrrrrrr
LeaveField_Date
not a valid date, use:
leaveField
xisType(
xa valid
r, use:" &&
LeaveField_Date
tbk_wid_name
1/1/6555
LeaveField_Time
not a valid time, use:
leaveField
xisType(
xa valid
I, use:" &&
LeaveField_Time
tbk_wid_name
12:00:00 AM
Pattern match:
Alpha - whitespace:
Date:
Time:
Bring up the Command Window
Bring up the Command Window
This one line script brings up the Command Window without using the Command menu item or the Shift + F3 key. Often you will want to remove menu items that you aren't using at Author level, but you still need the Command window while working.
origPage
to handle buttonClick
show commandWindow
end buttonClick
original
Bring up the Command Window
label
ASYM_BeenHere
Bring up the Command Window
Get day of week from date
Validate Numerical Data, 2
label
ASYM_BeenHere
Validate Numerical Data, 2
The numerical value is validated after each keystroke.
The widget fields will only accept data of the type described in the fields to the left of the widgets. The widget tests the data after each keystroke.
Keystroke_Number
1234567890-+
1234567890
characterPosition
keyChar
key, isShift, isControl
ZSTRING characterTyped
= ansitoChar(
numberDigits =
characterPosition =
caretLocation
j = "."
~(".",
) = 0
h> 0
X> 1)
"1234567890-+"
"1234567890"
key =
Keystroke_Number
tbk_wid_name
4254.7644444444444444
Keystroke_Int
1234567890-+
1234567890
keyChar
key, isShift, isControl
ZSTRING characterTyped
"1234567890"
caretLocation
"1,0"
"1234567890-+"
Keystroke_Int
tbk_wid_name
-567563
Keystroke_PosNum
1234567890
1234567890+
keyChar
key, isShift, isControl
ZSTRING characterTyped
= ansitoChar(
numberDigits =
"1234567890+"
_ = "."
~(".",
) = 0
"1234567890"
Keystroke_PosNum
tbk_wid_name
98.56577577776565777
Keystroke_PosInt
numberDigits
1234567890
1234567890+
keyChar
key, isShift, isControl
ZSTRING characterTyped
= ansitoChar(
numberDigits =
"1234567890+"
"1234567890"
Keystroke_PosInt
tbk_wid_name
8765408765444
Number:
Integer:
PosNum:er
PosInt:
Spin controls
origPage
original
Spin controls
label
Spin controls
Below are some standard spin controls for selecting an integer, date, or time. To use the date and time spinners, click on the segment of the date or time (e.g., month, minute) that you want to increment or decrement.
Try out the spinners on the right.
To use the date and time spinners, first click on the segment of the date or time (e.g., month, minute) that you want to increment or decrement.
integerUp
integer
spinUp
w%spinUp
buttonDown
w%spinUp
buttonDoubleClick
w%spinUp
buttonStillDown
spinUp
"integer"
integerDown
integer
spinDown
|spinDown
buttonDown
|spinDown
buttonDoubleClick
|spinDown
buttonStillDown
spinDown
"integer"
integer
dateButtons
decrement
dateUp
increment
month
month
actionItem
buttonDown
buttondoubleclick
buttonStillDown
"dateUp"
actionItem
selectedHotwords
"day"
"month"
"year"
dateUp
dateDown
increment
evaluate(day)
03 / 13 / 944
month
timeButtons
decrement
timeUp
;seconds
increment
seconds
minute
minute
actionItem
buttonDown
buttondoubleclick
buttonStillDown
"timeUp"
actionItem
selectedHotwords
"hour"
"Time"
"minute"
"AMPM"
timeUp
timeDown
increment
evaluate(day)
08 : 42 : 45 PMM
minute
seconds
ASYM_BeenHere
Limit Length of Entry String
origPage
original
Limit Length of Entry String
label
Limit Length of Entry Stringr
This handler is to be installed into the script of a field. When a key is pressed, it checks that the charCount of the text of the field is within the limits specified in the script.
This is a handler for a built-in ToolBook message that is sent to a field each time the user presses a key. Along with the keyChar message, Toolbook passes a parameter containing the unique code for the key pressed.
Handler: keyChar keyPressedsseddddameters are:
keyPressed the key pressed by the user
-- does not allow entry of more than specified
-- amount of characters. Place this handler in a field.
to handle keyChar keyPressed
local INT maxCharAllowed
local INT currentCount
maxCharAllowed = 10
currentCount = charCount(my text)
if (currentCount >= maxCharAllowed) \
or (keyPressed = keyEnter and currentCount >= \
maxCharAllowed - 1)
beep 1
else
forward
ASYM_BeenHere
Limit Length of Entry String
Cursor Resources
Add number of days to date
Check for Alpha Non-Numeric Data
origPage
original
Check for Alpha Non-Numeric Data
label
Check for Alpha Non-Numeric Data
This function checks each character to ensure that it is a letter from in the range of A-Z or a-z. To allow additional values or characters, you will need to add them to the string held in the variable "alphabet."
Handler: isStringAlpha (<testString>)
Parameters:
<testString>
Returns true if the string contains only alpha characters or null.
pha characters or null.
true testString contained only alpha characters (A-Z or a-z) or NULL
false testString contained at least one non-alpha character
-- tests each character of testString, returns TRUE
-- if all are alpha (non-numeric)
to get isStringAlpha testString
alphabet = "abcdefghijklmnopqrstuvwxyz"
step i from 1 to charcount(testString)
if char i of testString is not in alphabet
return FALSE
end
return TRUE
ASYM_BeenHere
Bring ToolBook Window to Front
Bring ToolBook Window to Front
This script uses DDE to get the sysWindowHandle of another instance of ToolBook. It then calls Windows to bring that window to the front of the desktop. If that application is not running, it runs it.
Handler: bringWindowToFront <application>
Parameters:
<application>: the name of theToolBook file
to handle bringWindowToFront appNameToRun
linkDLL "user"
--bringWindowToTop is a Windows function that
--puts the Window whose window handle is passed to it
This function will run Excel if it is not running already. If a filename is passed to this function it will tell Excel to load that file if it is not loaded already.
Handler: InitializeExcel (<fileName>)
Parameters:
<filename> optional; makes sure the file is open in Excel
Returns true if it successfully established conversation with Excel
false couldn't load Excel or, if provided, the file name given
SysError values are those of the command executeRemote (see the OpenScript Encyclopedia).
OK Conversation was succesfully established
Failed:No Server Excel is not running with the expected file
Failed: xxxxx Excel is running, but something is wrong
-- only puts page on syshistory if navigation is *not* initiated by BACK
if targetWindow is mainWindow
if s_backMessageSent is false
push this page onto syshistory
else
s_backMessageSent = false
end
forward
to handle back
system s_backMessageSent
if itemcount(syshistory) > 0
s_backMessageSent = true
pop syshistory
in mainwindow
go to it
end
else
request "You are already all the way back."
Changing the behavior of BACK
Changing the behavior of BACK
These handlers, when placed in the book script of a ToolBook application, will make the BACK message behave like back behaves in WinHelp.
Note: be sure you forward any leavePage handlers located in a page or background script.
Handlers:
EnterApplication
LeavePage
ASYM_BeenHere
Spin controls
Graphic slider control
Check for Valid File Name
Search Path for File
Verbose
Sorting a 1-D array
label
Sorting a 1-D array
-- The next three handlers make up a Standard recursive
-- QuickSort.
to handle quicksort fArray[] by reference
system s_noSwap
set s_noSwap to 0
send quicksrt fArray, 1, dimensions ( fArray )
to handle quicksrt fArray[] by reference, lo, hi
system s_noSwap
if hi > lo
send swap fArray, lo, ((lo+hi) div 2)
set lst to lo
step i from (lo+1) to hi
if fArray[i] < fArray[lo] as text
increment lst
send swap fArray, lst, i
else
increment s_noswap
end
end
send swap fArray,lo,lst
send quicksrt fArray, lo, lst-1
send quicksrt fArray, lst+1,hi
end
to handle swap fArray[] by reference, x, y
local temp
set temp to fArray[x]
set fArray[x] to fArray[y]
set fArray[y] to temp
end fArray[x]
set fArray[x] to fArray[y]
set fArray[y] to temp
This is an OpenScript implementation of the standard recursive quick sort.
Handler: quickSort <arrayRef>
Parameter:
<arrayRef>: A one-dimensional array.
Example:
local fArray[]
fill fArray with my text in [textline] order
send quickSort fArray
ASYM_BeenHere
Search Path for File
origPage
Search Path for File
This script links to the function getDosEnvironmentString in TB40DOS.DLL to get the DOS path and then determines if the file is in that path.
Handler: fileInPath (<fileName>)
Parameters:
<fileName> file name to search for
Returns null if file is not found, or the first directory in the path that contains the file if found.
NULL file not found
currentPath the first directory in the path that contains the file
Null parameter no file name was passed to function
name was passed to function
to get FileInPath fileNameToCheck
--If fileNameToCheck is null then fail immediately
if fileNameToCheck is NULL then
return null
end if
--Link to the tb40dos dll
linkDLL "tb40dos.dll"
INT fileExists (STRING)
STRING getDOSEnvironmentString (STRING)
end linkDLL
--Get the path list
set currentPathList to getDOSEnvironmentString ("PATH")
--Clear the 'Path=' at the beginning of the path list
get offset("=",currentPathList)
if it > 0 then
clear chars 1 to it of currentPathList
end if
--Convert the path list to a list of items
get offset(";",currentPathList)
while it > 0
set char it of currentPathList to ","
get offset(";",currentPathList)
end while
--Search through the list, one path at a time
while currentPathList is not NULL
pop currentPathList into checkPath
if last char of checkPath is not "\"
put "\" after checkPath
end if
if fileExists(checkPath & fileNameToCheck) = 1
return checkPath
end if
end while
--Unable to find file in the path
return null
original
Search Path for File
label
ASYM_BeenHere
Get Current Path Setting
origPage
original
Get Current Path Setting<
This script links to the function getDosEnvironmentString in TB40DOS.DLL to get the current DOS path setting. This handler returns the path currently specified in your DOS environment.
Handler: findCurrentPath
No parameters.
RRath setting
to get findCurrentPath
--Link to the tb40dos dll
linkDLL "tb40dos.dll"
STRING getDOSEnvironmentString (STRING)
end linkDLL
--Get the path list
set currentPathSetting to getDOSEnvironmentString ("PATH")
return currentPathSetting
end findCurrentPath
Get Current Path Setting
label
ASYM_BeenHere
Get Current Path Setting
Remove given char from string
Convert textlines to list
Insert/Overwrite field
origPage
original
Insert/Overwrite field
label
ASYM_BeenHere
Insert/Overwrite field
The upper field toggles between insert and overwrite mode when you press the insert key, the lower field indicates the mode. All handlers are in the fields.
Type in the field to the right.
Pressing the insert key toggles between insert and overwrite modes. The small field below reports the current mode.
insert/overwrite
overWriteFlag
false
keyDown
overWriteFlag
keyChar
overWriteFlag
enterpage
4logical overWriteFlag
Y <>
notifybefore
notifyafter
Now is the time for all good men to come to the aid of their country.s............................................wwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
Toggle
overWriteFlag
keyDown
overWriteFlag
enterPage
notifyAfter
4LOGICAL overWriteFlag
Insert_Overstrike_Toggle
tbk_wid_name
terPage
keyDown
enterPage
enterpage
,&H.&
RPhT`
Auto-scroll field
Converting to Binary, Hex, Octal
intro
<Introduction>
Dragging Objects
label
ASYM_BeenHere
Dragging Objects5
Put the script below in an object that you want to drag with the mouse.
Handler: buttonDown
Parameters: loc (location of mouse click)
to handle buttonDown loc
local stack bnds,mouseOffset
linkdll "user"
int getsystemmetrics(int)
-- check if the user has swapped mouse buttons.
if getSystemMetrics(23) >0
set leftMouseButton to keyRightButton
else
set leftMouseButton to keyLeftButton
set bnds to bounds of target
set mouseOffset to item 1 of loc - item 1 of bnds,\
item 2 of loc - item 2 of bnds
leftMouseButton=keyLeftButton
while keyState(leftMouseButton)is down
newloc = sysMousePosition
if newLoc <> loc
set position of target to \
item 1 of newLoc-item 1 of mouseOffset,\
item 2 of newLoc-item 2 of mouseOffset
set loc to newLoc
end if
end while
end buttonDown
Display 2-D array values
Testola
description only
subtopicname
in,ms
ThreeDeeRect
bottomLine
topLine
explanation
9505100024541471761132477470
ASYM_TpID
Converting to Binary, Hex, Octal
origPage
original
Converting to Binary, Hex, Octal
label
Converting to Binary, Hex, Octal
The Format command has been extended to allow conversion between Binary, Hex, and Octal number systems. The following are the new format strings
Binary: "@b"
Octal: "@o"
Hex: "@h"
Decimal: "@d"
These strings precede the normal number format string. So to convert a variable "n" from decimal to hexidecimal, you could use the following command:
format number n as "@h0"
To convert it back to decimal, you'd do this:
format number n as "@d0" from "@h0"
is "Hexidecimal"
format number numberEntered as "@h#"
else
format number numberEntered as "@o#"
end conditions
return numberEntered
end doConversion
ASYM_BeenHere
Binary Insertion of Textline
origPage
original
Binary Insertion of Textline
label
Binary Insertion of Textline into Field
Inserts a textline into a string delimited by CRLFs, maintaining sorted order.
Handler: InsertLine (<txt>,<newLine>)
Parameters:
<txt> Text, sorted by textLine
<newLine> The new line to insert.
Example of use:
text of field "f" = insertLine(text of field "f",newLine)
-- use if inserting a single line. Will maintain sorted order
to get insertLine txt,newLine
if txt is null
return newLine
set start to 1 -- first textline
set tlc to textlinecount(txt)
set ending to tlc -- last textline
local insertSpot
while start <= ending
set midPoint to (start+ending) div 2
set middleLine to textline midPoint of txt
conditions
when newLine < middleLine as text
-- start looking at values less than current midPoint
set ending to midPoint-1
set insertSpot to midPoint
when newLine > middleLine as text
-- start looking at values greater than current midPoint
set start to midPoint+1
set insertSpot to midPoint+1
else
-- the item already exists
set insertSpot to midPoint
break while
end
if insertSpot > tlc
put newLine before textline insertSpot of txt
else
put newLine&crlf before textline insertSpot of txt
return txt
ASYM_BeenHere
ASYM_BeenHere
label
Making mmSource-paths book relative
If you've saved your clips with fully qualified paths to their source files, you will probably want to change them so that they are relative to the location of the book so that the clips can be easily found using the HDMediaPath or CDMediaPath when installed on another machine. This routine runs through your resources and makes them relative to the book path. For example:
The following functions are useful for dealing with windows functions that require or return a RECT structure.
setRect <vertices>,<pRect>
This sets the values of the RECT structure in pRect. Useful if you must pass a filled RECT structure to a Windows function.
Parameters:
<vertices>: The vertices of the rectangle.
<pRect>: The pointer to the RECT structure. (8 bytes)
getRect <pRect>
This extracts the vertices from a filled RECT structure.
Parameter: <pRect>: The pointer to a RECT structure. (8 bytes)
getWinPointer ( <nsize> )
Use this to get a locked pointer.
Parameter: <nsize>: the size in bytes to allocate
Return value: Returns a reference to a locked pointer that you can pass
to a windows function requiring a pointer.
freeWinPointer (<pointer Variable>)
Frees a locked pointer, recovering memory.
Parameter: <pointer variable>: the variable returned from
getWinPointer()
Return value: Returns 0 if successful, a positive integer if not.
linkMemFunctions
Links the functions necessary for the above handlers.
Parameters: None.....Functions
Links the functions necessary for the above handlers.
Parameters: None...e.y for the above handlers.
Parameters: None.
-- lst is a list of 4 integers
-- pRect is a locked pointer to 8 bytes
to handle setRect lst,pRect
step i from 0 to 6 by 2
pop lst
get pointerInt(i,pRect,it)
-- pRect is a locked pointer to 8 bytes
to get getRect pRect
local retval
step i from 6 to 0 by -2
push pointerInt(i,pRect) onto retval
return retval
-- the link statements for needed functions below
to handle linkMemFunctions
linkDLL "KERNEL"
WORD GlobalAlloc(WORD,DWORD)
WORD GlobalFree(WORD)
WORD GlobalHandle(WORD)
POINTER GlobalLock(WORD)
WORD GlobalUnlock(WORD)
to get getWinPointer nSize
local word hMem
local retValue
hMem = GlobalAlloc(66,nSize)
return GlobalLock(hMem)
to get freeWinPointer pMem
local word hMem, retValue
hMem = GlobalHandle(item 1 of pMem)
retValue = GlobalUnlock(hMem)
return GlobalFree(hMem)
enddddddddddddddddddd
return GlobalFree(hMem)
ASYM_BeenHere
Sorting a 2-D array
origPage
original
Sorting a 2-D array
label
Sorting a 2-D array
Think of a 2-D array as a table in which the first dimension refers to rows and the second dimension refers to columns. This function sorts the "rows" of a two dimensional array by the values of one of its columns.
You pass it the array you want to sort, the column you want to sort by, and the "datatype" of the column you want to sort. (Either "text", "date", or "number")/
Click on the radio buttons to the right to sort the table by the associated column.
Note: the "table" to the right is a tab-delimited field with two vertical lines drawn over it. The handlers in the buttons load this text into a 2D array and pass it to a handler in this page, specifying the column and type for the sort. rt.
stwoDquickSort
sortField
buttonclick
buttonclick
Zretval
Zx[][]
fref
"sortField"
fill x
g] order
calls the sorting routine. Note
column
'array
specified,
be sorted
twoDquickSort x,1,"
part loads
dimensions(x)
x[i][j]
Number
stwoDquickSort
number
sortField
buttonclick
buttonclick
Zretval
Zx[][]
fref
"sortField"
fill x
g] order
twoDquickSort x,2,"
dimensions(x)
x[i][j]
Number
stwoDquickSort
sortField
buttonclick
buttonclick
Zretval
Zx[][]
fref
"sortField"
fill x
g] order
twoDquickSort x,3,"
dimensions(x)
x[i][j]
Sort by:
sortField
a 3 5/23/91
b 2 3/11/92
c 4 4/1/06
d 9 11/13/66
e 0 7/4/76
f 6 7/7/64
g 7 4/1/23
h 1 2/9/55
i 5 3/1/29
a 8 1/12/93
ASYM_BeenHere
Using a RECT structure
isLeapYear()
Get number of days in month
Key Up
Key Down
Enter Key lo Right Up
Enter Key lo Right Down
Enter key lo Left Up
Enter key Lo Left Down
Enter Key hi Left Up
Enter key hi Left Down
Enter Key hi Right Up
Enter key hi Right Up
Key Up Left
Key Down Left
Key Up Right
Key Down Right
Key Up Center
Key Down Center
dragApple
dragOrange
Get path of current book
label
Get path of current book
to get myPath
get name of this book
step i from charcount(it) to 1 by -1
if char i of it is "\"
return chars 1 to i of it
end
return null -- happens only when the book is untitled
This function returns the path of the current book.
Example of calling this function in a book called c:\books\test.tbk:
get myPath(this book)
Returns "c:\books\""
ASYM_BeenHere
invertedButton
.isChild
NON-ALPHA
,toggleInvert
invertedButtonClass
ALPHA
txClassName
label
buttonStillDown
buttonDoubleC
resize
Get Free Disk Space on a Drive
origPage
original
Get Free Disk Space on a DriveB
This script links to the function called getFreeDiskSpace in the tb40dos.dll to get the amount of disk space currently available on a particular drive.
Handler: findDiskSpace (<drive>)
Parameters:
<drive> the name of the drive to check
Returns the amount of space available on a particular drive..ror
ve an error
to get findDiskSpace whatDrive
local LONG diskSpaceAvailable
--Link to the tb40dos dll
linkDLL "tb40dos.dll"
LONG getFreeDiskSpace(STRING)
end linkDLL
set diskSpaceAvailable to getFreeDiskSpace(whatDrive)
return diskSpaceAvailable
Get Free Disk Space on a Drive
label
ASYM_BeenHere
Get Free Disk Space on a Drive
Exit and restart windows
Insert/Overwrite field
Recording wave files from CD
label
ASYM_BeenHere
Recording wave files from CD
You can record clips from a CD to wave files using the utility below. Copy the object to a book with some clips, and then specify the channels, sample rate, bits per sample, and file name.
This group of objects will record an existing CDAudio clip to a wave file on the disk.
NOTE: must have your CD Player connected to your sound board for this function to work....
Clip Chooser
CdresetContents
enterpage
CdresetContents
clips
whatClip
CDAudio
resetContents
notifyBefore
resetContents
notifyAfter
[dropdownitems
clips = resourceList(
<> NULL
whatClip
mmSource
= "CDAudio"
6&CRLF
"&"E&
dropDownItems
D:\HOOKWORK\CLIPS.TBK
lookBook
clip "CD Audio"
clip "CD Audio"
Channels
Stereo 2
Mono 1
Stereo 2
sample rate
22 kHz 22050
11 kHz 11025
22 kHz 22050
44 kHz 44100
bits/sample
16z 11025
22 kHz 22050
44 kHz 44100
Record Wavefile
Record Wavefile
CDAudio Clip to Record
Channels
Sample Rate
Bits/Sample
enterpage
Convert textlines to list
origPage
original
Convert textlines to list
label
Convert textlines to list
This handler converts a string delimited by CRLFs to a list.
Handler: textLinesToList (<textLines>)
Parameters:
<textLines> a string delimited by CRLFs
Returns a list, each item representing a textline.................
-- converts string delimited by CRLFs to a list
to get textLinesToList txt
local stack lst
step i from textlinecount(txt) to 1 by - 1
push textline i of txt onto lst
return lst
ASYM_BeenHere
Exit and restart windows
Exit and restart windows
label
--When restart is true, Windows will exit and restart.
--If restart is null or false, Windows will just exit.
to handle exitWindows restart
linkDLL "user"
INT ExitWindows (DWORD, INT)
end linkDLL
if restart is true
get ExitWindows (66, 0)
else
get ExitWindows (0, 0)
end
-- You can also use "67" to reboot the machineeee get ExitWindows (67, 0)
end
end
end
end buttonUp
nd buttonUp
nd buttonUp
Calling this handler will cause Windows to exit. You can optionally specify that Windows restarts after exiting.
Handler: exitWindows <restart>
Parameters:
<restart> True if you want to restart Windows
n Windows will just Exit.
origPage
original
Exit and restart windows
ASYM_BeenHere
Get day of week from date
Get day of week from date
label
-- returns the weekday of any day beyond 1/1/1700:
-- note: requires full year. Example: get weekDay("1/1/1993")
-- also requires isLeapYear() function below
to get dayOfWeek pdate
-- make a list out of the date
format date pdate as "m,d,y" from "m/d/y"
set m to item 1 of pdate
set d to item 2 of pdate
set y to item 3 of pdate
-- the following list (1 item for each month) contains the
-- number of days that have passed before first day of
-- each month.
set days to "0,31,59,90,120,151,181,212,243,273,304,334"
-- set numdays to number of days elapsed since 1/1/1700
set numdays to (y-1700) div 4-(y-1700) div 100 +(y-1600) \
div 400 + 365 * (y - 1700) + item m of days + d -1
-- Returns TRUE if y is a leap year, FALSE if not.
-- NOTE: this fuction requires a four digit year.
-- Example: Find out if 1992 is a leap year.
-- if leapYear(1992)
to get isLeapYear y
if ((y mod 4 = 0 and y mod 100 <> 0) or (y mod 400 = 0))
return TRUE
else
return FALSE
urn TRUE
else
return FALSE
This handler returns the day of the week (Monday, Tuesday, etc) from any given date since 1/1/1700. Note that you must provide a four-digit year.
Note that this function requires the handler isLeapYear, included below.
Handler: dayOfWeek(<date>)
Parameters:
<date> A date in this format: "1/1/1994"
(Note a four-digit year is required.)
year is required.)
origPage
original
Get day of week from date
ASYM_BeenHere
isLeapYear()
isLeapYear()
label
This function returns true if a given date is a leap year, false if not. Note that it requires a four digit year.
Handler: isLeapYear (<year>)
Parameters:
<year>: a four-digit number representing a year
-- Returns TRUE if y is a leap year, FALSE if not.
-- NOTE: this fuction requires a four digit year.
-- Example: Find out if 1992 is a leap year.
-- if leapYear(1992)
to get isLeapYear y
if ((y mod 4 = 0 and y mod 100 <> 0) or (y mod 400 = 0))
return TRUE
else
return FALSE
origPage
original
isLeapYear()
ASYM_BeenHere
ND, OR, and XOR
AutoPageName
Sorting a 2-D array
intro
SubtopicName
95051000040014592225940240
ASYM_TpID
Simple Drop Down Field
Remove trailing spaces
<Introduction>
origPage
10,14
selectChars
original
<Introduction>
label
Introduction
This book is a library of scripts and objects useful in OpenScript programming.
To go to a given topic, click a topic in the list.
To view topics related to a given category, choose the desired category.
Use the search button to search for a topic by key word.
Use the splitter bar to resize the navigation panel to the left.
Note: you can add new topics to this book by pressing F3 (to enter author mode) and using the topic buttons that appear at the lower left.appear at the lower left.
Yes, this is a button.
buttonclick
buttonclick
"Yes,
Yes, this is a button.
buttonclick
buttonclick
"Yes,
out,true
ThreeDeeRect
bottomLine
topLine
OpenScript
Libraryy Base
ASYM_BeenHere
<About this book>
Binary Insertion of Textline
scriptChooserDialog
ButtonStillDown Page Navigation
ButtonStillDown Page Navigation
These simple scripts implement multiple page navigation when the mouse button is held down.
Handlers:
buttonDown
buttonStillDown
No parameters
none
ering actions (ie - called XXbuttonDown rather than buttonDown)
Handlers in this script are:
buttonDown
Parameters are:
none
to handle buttonDown
go to next page
end buttonDown
to handle buttonStillDown
send buttondown
end buttonStillDown
tonDown
to handle XXbuttonStillDown
send buttondown
end XXbuttonStillDown
origPage
original
ButtonStillDown Page Navigation
label
ASYM_BeenHere
Play clip in a loop
label
ASYM_BeenHere
Play clip in a loop
If you want to have a wave or midi file constantly repeat in the background, use the scripts below.pts
Pressing the Play Clip button will play the specified clip continuously.uously.
Clip Chooser
CdresetContents
enterpage
CdresetContents
clips
whatClip
resetContents
Stop Clip
play clips
closed
jwhatClip
Play Clip
selectChange
notifyBefore
resetContents
notifyAfter
[dropdownitems
clips = resourceList(
<> NULL
whatClip
&CRLF
r"&"E&
dropDownItems
selectChange
B"play
" = "Stop
mmStatus
") <> "closed"
mmClose (
" = "Play
D:\HOOKWORK\CLIPS.TBK
lookBook
clip "Asymetrix Logo"
clip "Asymetrix Logo"
clip "bird1"
clip "bird2"
clip "bird3"
clip "CD Audio"
clip "Chirp"
clip "lion"
clip "No No No"
clip "tiger"
clip "toad"
Play Clips
clip "bird2"
whatClip
Play Clip
Clip to play continuously
enterpage
leavePage
calMonth
calYear
displayDate
Navigation
Check for State Abbreviation
Auto-scroll Field
origPage
original
Auto-scroll Field
label
ASYM_BeenHere
Auto-scroll Field
This field's scrollbar automatically appears when necessary.
Type in the field to the right.
When appropriate, scroll bars will automatically appear.
zashowOrHideScrollbar
enterPage
zashowOrHideScrollbar
leaveField
zashowOrHideScrollbar
keyUp
zashowOrHideScrollbar
paste
zashowOrHideScrollbar
zashowOrHideScrollbar
clear
showOrHideScrollbar
notifyBefore
showOrHideScrollbar
notifyAfter
Widgets are stand-alone objects that can be copied and pasted into your applications. In most cases they are designed to work without modification of any scripts. dfg dfg
enterPage
rPage
clear
leaveField
keyUp
paste
description and example
9505100015091465911961295454
ASYM_TpID
SubtopicName
in,ms
ThreeDeeRect
bottomLine
topLine
explanation
.', "
scrolling
rectangle
explanation
enterpage
notifyBefore
fref
"explanation"
txtOver
8= 0
Example:
in,sculpted
ThreeDeeRect
bottomLine
topLine
View Scripts
details
author
reader
author
dotted
enterpage
notifybefore
buttonclick
Copy Objects
group
Copy Object
enterPage
buttonclick
notifyBefore
) > 1
K= "Copy Objects"
Copy Objects
author
reader
enterpage
keyUp
paste
clear
leaveField
950510195057217149960457500199
ASYM_TpID
Search and replace in a string
function searches txt
occurrences
searchString
replaces
freplaceString.
-- If asWord
Conly where
Tappears
-- (A
defined
that
preceded
followed
-- either
beginning
-- wordDelimit
common punctuation
mathematical operators.)
searchReplace txt,searchFor,replaceWith,
-- runningTotal = 1
-- totalChars=
-- searchLen=
-- replaceLen=
-- --
are legally adjacent
-- --
= " " &
k& "-+*/<>,()[];^=&.?':" &
curTxt
-- curOffset =
--
-- startPos = (
-- endPos = (
--
-- test
occurance
isolated
y- 1) \
+ 1 \
--
--
--
--
origPage
original
Search and replace in a string
label
ASYM_BeenHere
Search and replace in a string
This page contains a function that searches text for all occurrences of one string and replaces them with another. You can specify that you only want to replace the searched string if it's a whole word.
set curTxt to chars runningTotal to totalChars of txt
curOffset = offset(searchFor,curTxt)
if curOffset = 0
break while
else
startPos = (runningTotal+curOffset-1)
endPos = (runningTotal+curOffset+searchLen-2)
if asWord is true
-- test if this occurance is an isolated word:
if not ((startPos = 1 or char (startPos - 1) \
of txt is in wordDelimit) and\
(endPos = totalChars or char endPos + 1 \
of txt is in wordDelimit))
increment runningTotal by curOffset+searchLen-1
continue while
end
end
set chars startPos to endPos of txt to replaceWith
increment runningTotal by curOffset+replaceLen-1
increment totalChars by replaceLen - searchLen
end
return txt
replaceLen - searchLen
end
return txt
Try searching and replacing various words in the paragraph to the right.
Note: when the As Word button is checked, only strings that exist as whole words in the text will be substituted..............
searchReplace
The quick red fox jumped over the lumpy log. The fox, being inquisitive by nature and not really in any hurry, stopped to examine the underside of the log in an olfactory sort of way. "Those blasted dogs," he thought to himself. "Who do they think they are?" Seconds later he was ripped to shreds.hreds.
searchString
replaceString
rabbit
Search Textng
Replace Textng
searchAndReplace
Search and Replace
asWord
As Word
Playing random sounds
label
ASYM_BeenHere
Playing random sounds
Here is an example of playing clips at random. This could be used if you wanted to create ambient background noises.
This button will randomly play the selected clips in the background.
Play Clips
FALSE
isPlaying
delay
1,2,3,4,5,6
clipList
clip "tiger"
whatClip
Stop Clips
Select clips to play randomly
Clip Chooser
CdresetContents
enterpage
CdresetContents
.'+ +F
clips
whatClip
default
resetContents
notifyBefore
resetContents
notifyAfter
e= TRUE
clips = resourceList(
<> NULL
whatClip
SPACE&
i"&"E&
graphic
= bitmap (mmMediaType
CRLF
e= FALSE
= default
clip "Asymetrix Logo"
clip "No No No"
clip "toad"
clip "tiger"
clip "lion"
clip "bird3"
clip "bird2"
clip "bird1"
clip "CD Audio"
clip "Chirp"
animation
digitalVideo
bitmap
cdAudio
sequencer
photoCD
videoDisk
waveAudio
overlay
RadioButtons
play clips
delay
buttonclick
buttonclick
delay
B"play clips" =
Often
Normal
20000
Rarely
How often
enterPage
leavePage
Remove trailing spaces
Remove trailing spaces
label
This function removes all trailing spaces, as well as other undesirable characters.
Handler: trim(<string to trim>)
Parameters:
<string to trim> The string from which you want to remove the trailing stuff.
Returns the modified string
-- removes trailing spaces, tabs, and crlf's
to get trim strng
local charsToDrop
set charsToDrop to space & crlf & tab
while charcount(strng) > 0 and last char of strng is in charsToDrop
The script below allows you to turn on or off task-switching (Windows 3.X only). When task-switching is on the user may not change tasks by using Alt+Tab, Alt+Shift+Tab, or Ctrl+Esc. They may still activate other windows by clicking on them.
To turn off task-switching:
set taskSwitching() to FALSE
To turn task-switching back on:
set taskSwitching() to TRUE
to set taskSwitching to LOGICAL mode
if mode
untranslateWindowMessage 0x0112 for sysWindowHandle
else
translateWindowMessage for sysWindowHandle
on 0x0112 send WM_SYSCOMMAND
end
to handle WM_SYSCOMMAND hWnd, wMsg, wp, lpLo, lpHi